BackgroundWorker Module
Hosts long-running effects as ASP.NET Core background services, with AddEffectWorker.
Types
| Type | Description |
|
The hosted service |
Type extensions
| Type extension |
Description
|
Full Usage:
this.AddEffectWorker
Parameters:
IServiceProvider -> CancellationToken -> 'r
-
Creates the environment from the application's services and the host's stopping token
work : Expr<(CancellationToken -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, taking the host's stopping token and returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is created from the application's services and the host's stopping token. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
Example
val processMessages: ct: 'a -> 'b
val ct: 'a
|
Full Usage:
this.AddEffectWorker
Parameters:
CancellationToken -> 'r
-
Creates the environment from the host's stopping token
work : Expr<(CancellationToken -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, taking the host's stopping token and returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is created from the host's stopping token. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Full Usage:
this.AddEffectWorker
Parameters:
IServiceProvider -> 'r
-
Creates the environment from the application's services
work : Expr<(CancellationToken -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, taking the host's stopping token and returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is created from the application's services. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Full Usage:
this.AddEffectWorker
Parameters:
'r
-
The environment
work : Expr<(CancellationToken -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, taking the host's stopping token and returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is the one given. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Full Usage:
this.AddEffectWorker
Parameters:
IServiceProvider -> CancellationToken -> 'r
-
Creates the environment from the application's services and the host's stopping token
work : Expr<(unit -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is created from the application's services and the host's stopping token. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Full Usage:
this.AddEffectWorker
Parameters:
CancellationToken -> 'r
-
Creates the environment from the host's stopping token
work : Expr<(unit -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is created from the host's stopping token. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Full Usage:
this.AddEffectWorker
Parameters:
IServiceProvider -> 'r
-
Creates the environment from the application's services
work : Expr<(unit -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is created from the application's services. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Full Usage:
this.AddEffectWorker
Parameters:
'r
-
The environment
work : Expr<(unit -> Effect<'r, unit, 'e>)>
-
The worker: a function, passed directly so that its name can name the worker's logger, returning the effect to run
Returns: IServiceCollection
Type parameters: 'r, 'e |
Registers a hosted service that runs an effect in the background for the lifetime of the application. The environment is the one given. The effect is started again whenever it fails, and the worker stops when it completes successfully, so it is typically written as a loop.
Extended Type:
|
Orsak