Table of Contents

Class OptimisticConcurrencyStrategy

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

Represents an optimistic concurrency strategy for managing concurrency scopes.

public class OptimisticConcurrencyStrategy : IConcurrencyScopeStrategy
Inheritance
OptimisticConcurrencyStrategy
Implements
Inherited Members

Constructors

OptimisticConcurrencyStrategy(IEventSequence)

Represents an optimistic concurrency strategy for managing concurrency scopes.

public OptimisticConcurrencyStrategy(IEventSequence eventSequence)

Parameters

eventSequence IEventSequence

The IEventSequence to use for getting the tail sequence number.

Methods

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

Gets a ConcurrencyScope for the specified parameters.

public 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.