LifecycleSubject
class
Namespace: Orleans
Provides functionality for observing a lifecycle.
public abstract class LifecycleSubject : ILifecycleObservable, ILifecycleObserver, ILifecycleSubjectRemarks
- 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.
Constructors
Methods
CallObserverStopAsync(ILifecycleObserver, CancellationToken)GetStageName(int)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(int)Signifies thatLifecycleSubjectcompleted.OnStop(CancellationToken)Handle stop notifications.OnStopStageCompleted(int)Signifies thatLifecycleSubjectcompleted.PerfMeasureOnStart(int, TimeSpan)Logs the observed performance of anLifecycleSubjectcall.PerfMeasureOnStop(int, TimeSpan)Logs the observed performance of anLifecycleSubjectcall.Subscribe(string, int, ILifecycleObserver)Subscribe for notification when a stage is reached while starting or stopping.
