Class StatefulObserver<T>
Base class for stateful observer implementations, providing support to load and save observer state during checkpointing and recovery.
Implements
Inherited Members
Namespace: Reaqtive
Assembly: Reaqtive.Core.dll
Syntax
public abstract class StatefulObserver<T> : VersionedObserver<T>, IObserver<T>, ISubscription, IStatefulOperator, IOperator, IDisposable, IVersioned
Type Parameters
Name | Description |
---|---|
T | Type of the objects received by the observer. |
Constructors
StatefulObserver()
Declaration
protected StatefulObserver()
Properties
StateChanged
Gets a flag indicating whether state has changed since the last time the observer state got saved.
Declaration
public virtual bool StateChanged { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
LoadState(IOperatorStateReader, Version)
Loads the state of the observer.
Declaration
public void LoadState(IOperatorStateReader reader, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateReader | reader | Reader to read observer state from. |
System.Version | version | Version of the state. |
LoadStateCore(IOperatorStateReader)
Loads the state of the observer.
Declaration
protected virtual void LoadStateCore(IOperatorStateReader reader)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateReader | reader | Reader to read observer state from. |
LoadStateCore(IOperatorStateReader, Version)
Loads the state of the observer using the specified state version.
Declaration
protected virtual void LoadStateCore(IOperatorStateReader reader, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateReader | reader | Reader to read observer state from. |
System.Version | version | Version of the state being read. |
OnDispose()
Called when the observer is disposed.
Declaration
protected override void OnDispose()
Overrides
OnStateSaved()
Called when observer state was successfully saved.
Declaration
public virtual void OnStateSaved()
SaveState(IOperatorStateWriter, Version)
Saves the state of the operator.
Declaration
public void SaveState(IOperatorStateWriter writer, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateWriter | writer | Writer to write operator state to. |
System.Version | version | Version of the state being saved. |
SaveStateCore(IOperatorStateWriter)
Saves the state of the observer.
Declaration
protected virtual void SaveStateCore(IOperatorStateWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateWriter | writer | Writer to write observer state to. |
SaveStateCore(IOperatorStateWriter, Version)
Saves the state of the observer using the specified state version.
Declaration
protected virtual void SaveStateCore(IOperatorStateWriter writer, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateWriter | writer | Writer to write observer state to. |
System.Version | version | Version of the state being written. |