Class FireflyBackgroundPeriodicWorker
public abstract class FireflyBackgroundPeriodicWorker : FireflyBackgroundWorker
- Inheritance
-
objectFireflyBackgroundPeriodicWorker
- Inherited Members
Properties
AdaptiveTiming
When enabled, the execution time of ExecuteAsync() will be measured and removed from the delay duration for next cycle. Disabled by default
protected virtual bool AdaptiveTiming { get; }
Property Value
IsScoped
Is True, a new service/logging scope will be created for each heartbeat. If False, the root service scope will be provided
protected virtual bool IsScoped { get; set; }
Property Value
Period
The delay time in heartbeats. Set null to stop and exit heartbeat.
protected abstract TimeSpan? Period { get; }
Property Value
StartDelay
The delay time to wait before starting heartbeat.
protected virtual TimeSpan? StartDelay { get; }
Property Value
Methods
ExecuteAsync(IServiceProvider, CancellationToken)
Run you asynchronous worker heartbeat/logic in this method. Use the cancellation token to gracefully stop any processing
public abstract Task ExecuteAsync(IServiceProvider services, CancellationToken stoppingToken)
Parameters
servicesIServiceProviderstoppingTokenCancellationToken
Returns
ExecuteAsync(CancellationToken)
Run you asynchronous worker heartbeat/logic in this method. Use the cancellation token to gracefully stop any processing
protected override sealed Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationToken