Edit

Share via


LifecycleSubject Class

Definition

Provides functionality for observing a lifecycle.

public class LifecycleSubject : Orleans.ILifecycleSubject
public abstract class LifecycleSubject : Orleans.ILifecycleSubject
type LifecycleSubject = class
    interface ILifecycleSubject
    interface ILifecycleObservable
    interface ILifecycleObserver
Public Class LifecycleSubject
Implements ILifecycleSubject
Public MustInherit Class LifecycleSubject
Implements ILifecycleSubject
Inheritance
LifecycleSubject
Derived
Implements

Remarks

  • Single use, does not support multiple start/stop cycles.
  • Once started, no other observers can be subscribed.
  • OnStart starts stages in order until first failure or cancellation.
  • OnStop stops states in reverse order starting from highest started stage.
  • OnStop stops all stages regardless of errors even if canceled canceled.

Constructors

LifecycleSubject(ILogger)
LifecycleSubject(ILogger<LifecycleSubject>)

Fields

logger

Methods

GetStageName(Int32)

Gets the name of the specified numeric stage.

GetStageNames(Type)

Gets the collection of all stage numbers and their corresponding names.

OnStart(CancellationToken)

Handle start notifications.

OnStartStageCompleted(Int32)

Signifies that OnStart(CancellationToken) completed.

OnStop(CancellationToken)

Handle stop notifications.

OnStopStageCompleted(Int32)

Signifies that OnStop(CancellationToken) completed.

PerfMeasureOnStart(Int32, TimeSpan)

Logs the observed performance of an OnStart(CancellationToken) call.

PerfMeasureOnStop(Int32, TimeSpan)

Logs the observed performance of an OnStop(CancellationToken) call.

Subscribe(String, Int32, ILifecycleObserver)

Extension Methods

OnStart(ILifecycleObserver)
OnStop(ILifecycleObserver)
Subscribe(ILifecycleObservable, Int32, ILifecycleObserver)

Creates a disposable subscription to the lifecycle.

Subscribe(ILifecycleObservable, String, Int32, Func<CancellationToken,Task>, Func<CancellationToken,Task>)

Creates a disposable subscription to the lifecycle.

Subscribe(ILifecycleObservable, String, Int32, Func<CancellationToken,Task>)

Creates a disposable subscription to the lifecycle.

Subscribe<TObserver>(ILifecycleObservable, Int32, ILifecycleObserver)

Creates a disposable subscription to the lifecycle.

Subscribe<TObserver>(ILifecycleObservable, Int32, Func<CancellationToken,Task>, Func<CancellationToken,Task>)

Creates a disposable subscription to the lifecycle.

Subscribe<TObserver>(ILifecycleObservable, Int32, Func<CancellationToken,Task>)

Creates a disposable subscription to the lifecycle.

Applies to