Class ReadModelWatcher<TReadModel>

Namespace
Cratis.Chronicle.ReadModels
Assembly
Cratis.Chronicle.dll

Represents an implementation of IReadModelWatcher<TReadModel>.

public class ReadModelWatcher<TReadModel> : IReadModelWatcher<TReadModel>, IReadModelWatcher, IDisposable

Type Parameters

TReadModel

Type of read model the watcher is for.

Inheritance
ReadModelWatcher<TReadModel>
Implements
IReadModelWatcher<TReadModel>
Inherited Members
Extension Methods

Constructors

ReadModelWatcher(IEventStore, Action, JsonSerializerOptions)

Initializes a new instance of the ReadModelWatcher<TReadModel> class.

public ReadModelWatcher(IEventStore eventStore, Action stopped, JsonSerializerOptions jsonSerializerOptions)

Parameters

eventStore IEventStore

IEventStore the watcher is for.

stopped Action

Callback for when the watcher is stopped.

jsonSerializerOptions JsonSerializerOptions

Options for JSON serialization.

Properties

Observable

Gets the observable for the read model.

public IObservable<ReadModelChangeset<TReadModel>> Observable { get; }

Property Value

IObservable<ReadModelChangeset<TReadModel>>

Subscribed

Gets a Task that completes once the watcher's underlying change-stream subscription on the server has been established. Awaiting this guarantees that any events appended afterwards will be observed through Observable.

public Task Subscribed { get; }

Property Value

Task

Methods

Dispose()

public void Dispose()

Start()

Start the watcher.

public void Start()

Stop()

Stop the watcher. Will be removed from the manager.

public void Stop()