Class Observers

Namespace
Cratis.Chronicle.Observation
Assembly
Cratis.Chronicle.dll

Represents an implementation of IObservers.

public class Observers : IObservers
Inheritance
Observers
Implements
Inherited Members
Extension Methods

Constructors

Observers(IEventStore)

Represents an implementation of IObservers.

public Observers(IEventStore eventStore)

Parameters

eventStore IEventStore

IEventStore the observers belong to.

Methods

GetAll()

Get every observer registered in the event store's current namespace.

public Task<IEnumerable<ObserverInformation>> GetAll()

Returns

Task<IEnumerable<ObserverInformation>>

A collection of ObserverInformation.

Remove(ObserverId)

Remove an observer and everything keyed to it.

public Task<ObserverRemovalResult> Remove(ObserverId observerId)

Parameters

observerId ObserverId

The ObserverId of the observer to remove.

Returns

Task<ObserverRemovalResult>

An ObserverRemovalResult describing what happened.

Remarks

For the observer whose declaring code is gone - a read model and its projection that were deleted, a reactor that was removed. The observer it registered stays behind, settles into Disconnected and keeps its records in the event store forever.

Removal covers the whole event store, because an observer's definition is a store-level record. It refuses while the observer is running or has a subscribed client in any namespace, so what it can remove is only ever an observer no client is reporting - stop the declaring application first if you mean to remove a live one. Read model data and sink containers are left untouched.