Table of Contents

Class FireflyBackgroundWorker

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll
public abstract class FireflyBackgroundWorker
Inheritance
object
FireflyBackgroundWorker
Derived

Properties

IsRunning

public bool IsRunning { get; }

Property Value

bool

IsStopped

public bool IsStopped { get; }

Property Value

bool

IsStopping

public bool IsStopping { get; }

Property Value

bool

RootServiceProvider

protected IServiceProvider RootServiceProvider { get; }

Property Value

IServiceProvider

logger

protected ILogger logger { get; }

Property Value

ILogger

Methods

CreateScope(out IServiceProvider)

protected FireflyBackgroundWorker.AsyncScope CreateScope(out IServiceProvider services)

Parameters

services IServiceProvider

Returns

FireflyBackgroundWorker.AsyncScope

CreateScope(out IServiceProvider, out RayId)

protected FireflyBackgroundWorker.AsyncScope CreateScope(out IServiceProvider services, out RayId rayId)

Parameters

services IServiceProvider
rayId RayId

Returns

FireflyBackgroundWorker.AsyncScope

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

Task

InitializeAsync(CancellationToken)

InitializeAsync() is awaited during the startup sequence.

protected virtual Task InitializeAsync(CancellationToken cancellation)

Parameters

cancellation CancellationToken

Returns

Task

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

Task

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

Task

OnStopAsync()

Called when service is shutting down

protected virtual Task OnStopAsync()

Returns

Task

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

Task

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

Returns

Task