Interface IEventStore
- Namespace
- Cratis.Chronicle
- Assembly
- Cratis.Chronicle.dll
Defines the event store API surface.
public interface IEventStore
- Extension Methods
Properties
Connection
Gets the IChronicleConnection used for the IEventStore.
IChronicleConnection Connection { get; }
Property Value
Constraints
Gets the IConstraints for the event store.
IConstraints Constraints { get; }
Property Value
Discovery
Gets the artifacts found by the last completed discovery pass, or NotRun. Reading this does not trigger discovery or indicate registration success.
DiscoveryReport Discovery { get; }
Property Value
EventLog
Gets the IEventLog event sequence.
IEventLog EventLog { get; }
Property Value
EventSources
Gets the IEventSources for the event store.
IEventSources EventSources { get; }
Property Value
Exceptions
- EventSourcesNotSupported
Thrown when the implementation does not support event sources.
EventTypes
Gets the IEventTypes for the event store.
IEventTypes EventTypes { get; }
Property Value
ExternalServices
Gets the IExternalServices for the event store.
IExternalServices ExternalServices { get; }
Property Value
FailedPartitions
Gets the IFailedPartitions for the event store.
IFailedPartitions FailedPartitions { get; }
Property Value
Identities
Gets the IIdentityManager for managing identities for the event store.
IIdentityManager Identities { get; }
Property Value
Jobs
Gets the IJobs for the event store.
IJobs Jobs { get; }
Property Value
Name
Gets the Name for the event store.
EventStoreName Name { get; }
Property Value
Namespace
Gets the namespace for the event store.
EventStoreNamespaceName Namespace { get; }
Property Value
Observers
Gets the IObservers for the event store, for operating on its observers.
IObservers Observers { get; }
Property Value
Remarks
Optional, so that an existing implementation of this interface - a test double, a scenario harness in a consuming framework - keeps compiling and loading without change. Adding a required member to an interface this widely implemented breaks every implementer at type-load time, before any of their code runs. The real event store implements it; anything that does not says so by throwing rather than by quietly answering.
Exceptions
- ObserversNotSupported
Thrown when the implementation does not support operating on observers.
Occurrences
Gets occurrence effect receipts bound to this store and namespace.
IOccurrences Occurrences { get; }
Property Value
Exceptions
- EffectReceiptsNotSupported
This implementation does not support occurrences.
PII
Gets the IPIIManager for managing PII encryption keys (GDPR right-to-erasure) for the event store.
IPIIManager PII { get; }
Property Value
Patterns
Gets the IPatterns for the event store.
IPatterns Patterns { get; }
Property Value
Remarks
Optional, so that an existing implementation of this interface - a test double, a scenario harness in a consuming framework - keeps compiling and loading without change. Adding a required member to an interface this widely implemented breaks every implementer at type-load time, before any of their code runs. The real event store implements it; anything that does not says so by throwing rather than by quietly answering.
Exceptions
- PatternsNotSupported
Thrown when the implementation does not support behavior patterns.
Projections
Gets the IProjections for the event store.
IProjections Projections { get; }
Property Value
Reactors
Gets the IReactors for the event store.
IReactors Reactors { get; }
Property Value
ReadModelReactors
Gets the IReadModelReactors for the event store.
IReadModelReactors ReadModelReactors { get; }
Property Value
ReadModels
Gets the IReadModels for the event store.
IReadModels ReadModels { get; }
Property Value
Reducers
Gets the IReducers for the event store.
IReducers Reducers { get; }
Property Value
Registration
Gets what became of the declared artifacts the last time RegisterAll() ran.
RegistrationOutcome Registration { get; }
Property Value
Remarks
This is NotRun until RegisterAll() has completed, and from then on reports every declared projection artifact as either registered or failed, carrying the failure that stopped it. It is read-only and decides nothing - what a consumer does about a failed artifact is the consumer's call.
Registration is wired to the connection lifecycle, so it runs on its own; reading this property never triggers
it. To block until it has run, use RegistrationWaitExtensions.WaitForRegistration. Do not poll
IsConnected as a substitute - see
RegistrationOutcome for why that races.
Seeding
Gets the IEventSeeding for the event store.
IEventSeeding Seeding { get; }
Property Value
Subscriptions
Gets the IEventStoreSubscriptions for the event store.
IEventStoreSubscriptions Subscriptions { get; }
Property Value
UnitOfWorkManager
Gets the IClientArtifactsProvider for the event store.
IUnitOfWorkManager UnitOfWorkManager { get; }
Property Value
Webhooks
Gets the IWebhooks for the event store.
IWebhooks Webhooks { get; }
Property Value
Methods
DiscoverAll()
Discover all artifacts for the event store.
Task DiscoverAll()
Returns
- Task
Awaitable task.
GetEventSequence(EventSequenceId)
Get an event sequence by id.
IEventSequence GetEventSequence(EventSequenceId id)
Parameters
idEventSequenceIdThe identifier of the event sequence to get.
Returns
- IEventSequence
IEventSequence instance.
GetNamespaces(CancellationToken)
List namespaces in the event store.
Task<IEnumerable<EventStoreNamespaceName>> GetNamespaces(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenOptional CancellationToken.
Returns
- Task<IEnumerable<EventStoreNamespaceName>>
An asynchronous enumerable for all namespace names.
RegisterAll()
Register all artifacts for the event store.
Task RegisterAll()
Returns
- Task
Awaitable task.
RemoveNamespace(EventStoreNamespaceName, CancellationToken)
Remove a namespace from the event store, together with its observers, their reminders and the data Chronicle stores for it. Clients connected to the namespace must stop using it first. Removing a namespace that does not exist does nothing; the default namespace cannot be removed.
Task RemoveNamespace(EventStoreNamespaceName @namespace, CancellationToken cancellationToken = default)
Parameters
namespaceEventStoreNamespaceNameThe EventStoreNamespaceName to remove.
cancellationTokenCancellationTokenOptional CancellationToken.
Returns
- Task
Awaitable task.
Exceptions
- NotSupportedException
The event store does not support removing namespaces.