Class FireflyBackgroundWorker
public abstract class FireflyBackgroundWorker
- Inheritance
-
objectFireflyBackgroundWorker
- Derived
Properties
IsRunning
public bool IsRunning { get; }
Property Value
IsStopped
public bool IsStopped { get; }
Property Value
IsStopping
public bool IsStopping { get; }
Property Value
RootServiceProvider
protected IServiceProvider RootServiceProvider { get; }
Property Value
logger
protected ILogger logger { get; }
Property Value
Methods
CreateScope(out IServiceProvider)
protected FireflyBackgroundWorker.AsyncScope CreateScope(out IServiceProvider services)
Parameters
services
IServiceProvider
Returns
CreateScope(out IServiceProvider, out RayId)
protected FireflyBackgroundWorker.AsyncScope CreateScope(out IServiceProvider services, out RayId rayId)
Parameters
services
IServiceProviderrayId
RayId
Returns
ExecuteAsync(CancellationToken)
Run you asynchronous worker heartbeat/logic in this method. Use the cancellation token to gracefully stop any processing
protected abstract Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingToken
CancellationToken
Returns
InitializeAsync(CancellationToken)
InitializeAsync() is awaited during the startup sequence.
protected virtual Task InitializeAsync(CancellationToken cancellation)
Parameters
cancellation
CancellationToken
Returns
OnStartAsync(CancellationToken)
Called after all FireflyBackgroundWorkers have been initialized and are starting. This is called in a different Task that the start sequence, thus delays here will not affect startup time.
protected virtual Task OnStartAsync(CancellationToken cancellation)
Parameters
cancellation
CancellationToken
Returns
OnStartingAsync(CancellationToken)
Called after all FireflyBackgroundWorkers have been initialized and before Start. this method is awaited during start sequence, so delays will affect total startup-time
protected virtual Task OnStartingAsync(CancellationToken cancellation)
Parameters
cancellation
CancellationToken
Returns
OnStopAsync()
Called when service is shutting down
protected virtual Task OnStopAsync()
Returns
OnStoppedAsync(CancellationToken)
Called after FireflyBackgroundWorkers are stopped. This method is awaited during stop sequence, so delays will affect total shutdown-time
protected virtual Task OnStoppedAsync(CancellationToken cancellation)
Parameters
cancellation
CancellationToken
Returns
OnStoppingAsync(CancellationToken)
Called before FireflyBackgroundWorkers are signaled to stop. This method is awaited during stop sequence, so delays will affect total shutdown-time
protected virtual Task OnStoppingAsync(CancellationToken cancellation)
Parameters
cancellation
CancellationToken