Interface IConcurrencyScopeStrategy

Namespace
Cratis.Chronicle.EventSequences.Concurrency
Assembly
Cratis.Chronicle.dll

Defines a strategy for managing concurrency scopes.

public interface IConcurrencyScopeStrategy
Extension Methods

Methods

GetScope(ConcurrencyDimensions, EventSourceId, EventStreamType?, EventStreamId?, EventSourceType?, IEnumerable<EventType>?)

Gets the ConcurrencyScope, narrowed to the dimensions an event source or event stream declares.

Task<ConcurrencyScope> GetScope(ConcurrencyDimensions dimensions, EventSourceId eventSourceId, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, IEnumerable<EventType>? eventTypes = null)

Parameters

dimensions ConcurrencyDimensions

The ConcurrencyDimensions that take part in the scope.

eventSourceId EventSourceId

The EventSourceId being appended to.

eventStreamType EventStreamType

Optional EventStreamType being appended to.

eventStreamId EventStreamId

Optional EventStreamId being appended to.

eventSourceType EventSourceType

Optional EventSourceType being appended to.

eventTypes IEnumerable<EventType>

Optional event types to scope the check to.

Returns

Task<ConcurrencyScope>

The ConcurrencyScope.

Remarks

None declares nothing and gives the same scope as the scope without dimensions. The default implementation leaves out the stream and event source type dimensions that are not declared, and always includes the event source id; a strategy that can also leave the event source id out overrides it.

GetScope(EventSourceId, EventStreamType?, EventStreamId?, EventSourceType?, IEnumerable<EventType>?)

Gets a ConcurrencyScope for the specified parameters.

Task<ConcurrencyScope> GetScope(EventSourceId eventSourceId, EventStreamType? eventStreamType = null, EventStreamId? eventStreamId = null, EventSourceType? eventSourceType = null, IEnumerable<EventType>? eventTypes = null)

Parameters

eventSourceId EventSourceId

The EventSourceId to scope to.

eventStreamType EventStreamType

Optional EventStreamType to scope to. Defaults to All.

eventStreamId EventStreamId

Optional EventStreamId to scope to. Defaults to Default.

eventSourceType EventSourceType

Optional EventSourceType to scope to. Defaults to Default.

eventTypes IEnumerable<EventType>

Optional collection of EventType to scope to. Defaults to no specific event types.

Returns

Task<ConcurrencyScope>

The ConcurrencyScope.