Table of Contents

Class FireflyBackgroundPeriodicWorker

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll
public abstract class FireflyBackgroundPeriodicWorker : FireflyBackgroundWorker
Inheritance
object
FireflyBackgroundPeriodicWorker
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

bool

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

bool

Period

The delay time in heartbeats. Set null to stop and exit heartbeat.

protected abstract TimeSpan? Period { get; }

Property Value

TimeSpan?

StartDelay

The delay time to wait before starting heartbeat.

protected virtual TimeSpan? StartDelay { get; }

Property Value

TimeSpan?

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

services IServiceProvider
stoppingToken CancellationToken

Returns

Task

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

stoppingToken CancellationToken

Returns

Task