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

eventStore IEventStore

The IEventStore the event sources belong to. Can be null for discovery only, in which case Register() is not possible.

clientArtifacts IClientArtifactsProvider

The IClientArtifactsProvider providing the event source types.

Properties

All

Gets all discovered event source definitions.

public IReadOnlyList<EventSourceDefinition> All { get; }

Property Value

IReadOnlyList<EventSourceDefinition>

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

name string

The name of the event source.

Returns

EventSourceDefinition

The EventSourceDefinition.

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

type Type

The type of the IEventSource.

Returns

EventSourceDefinition

The EventSourceDefinition.

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.