Interface IObservers

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

Defines a system for working with the observers of an event store.

public interface IObservers
Extension Methods

Methods

GetAll()

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

Task<IEnumerable<ObserverInformation>> GetAll()

Returns

Task<IEnumerable<ObserverInformation>>

A collection of ObserverInformation.

Remove(ObserverId)

Remove an observer and everything keyed to it.

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.