Class EventSources
- Namespace
- Cratis.Chronicle.EventSources
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of IEventSources.
public class EventSources : IEventSources
- Inheritance
-
EventSources
- Implements
- Inherited Members
- Extension Methods
Constructors
EventSources(IEventStore?, IClientArtifactsProvider)
Represents an implementation of IEventSources.
public EventSources(IEventStore? eventStore, IClientArtifactsProvider clientArtifacts)
Parameters
eventStoreIEventStoreThe IEventStore the event sources belong to. Can be null for discovery only, in which case Register() is not possible.
clientArtifactsIClientArtifactsProviderThe IClientArtifactsProvider providing the event source types.
Properties
All
Gets all discovered event source definitions.
public IReadOnlyList<EventSourceDefinition> All { get; }
Property Value
Methods
Discover()
Discover the event source definitions from the client artifacts.
public Task Discover()
Returns
- Task
Awaitable task.
Exceptions
- DuplicateEventSourceName
Thrown when two definitions share a name.
- DuplicateEventStreamName
Thrown when a definition declares the same stream twice.
GetFor(string)
Get the definition with a name.
public EventSourceDefinition GetFor(string name)
Parameters
namestringThe name of the event source.
Returns
Exceptions
- UnknownEventSource
Thrown when there is no event source with the name.
GetFor(Type)
Get the definition carried by a type.
public EventSourceDefinition GetFor(Type type)
Parameters
typeTypeThe type of the IEventSource.
Returns
Exceptions
- UnknownEventSource
Thrown when the type is not a discovered event source.
Register()
Register the discovered definitions with the Kernel.
public Task Register()
Returns
- Task
Awaitable task.