Skip to content

Interface IModuleLifecycle

Namespace: Cephalon.Abstractions.Modules
Assembly: Cephalon.Abstractions.dll

Defines the deterministic lifecycle hooks managed by the host runtime.

public interface IModuleLifecycle

InitializeAsync(ModuleContext, CancellationToken)

Section titled “ InitializeAsync(ModuleContext, CancellationToken)”

Initializes the module before the runtime starts serving work.

Task InitializeAsync(ModuleContext context, CancellationToken cancellationToken)

context ModuleContext

The module runtime context.

cancellationToken CancellationToken

A token that cancels initialization.

Task

A task that completes when initialization finishes.

StartAsync(ModuleContext, CancellationToken)

Section titled “ StartAsync(ModuleContext, CancellationToken)”

Starts the module after initialization has completed.

Task StartAsync(ModuleContext context, CancellationToken cancellationToken)

context ModuleContext

The module runtime context.

cancellationToken CancellationToken

A token that cancels startup.

Task

A task that completes when startup finishes.

StopAsync(ModuleContext, CancellationToken)

Section titled “ StopAsync(ModuleContext, CancellationToken)”

Stops the module during runtime shutdown.

Task StopAsync(ModuleContext context, CancellationToken cancellationToken)

context ModuleContext

The module runtime context.

cancellationToken CancellationToken

A token that cancels shutdown.

Task

A task that completes when shutdown finishes.