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
eventSequenceIEventSequenceThe 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
eventSourceIdEventSourceIdThe EventSourceId to scope to.
eventStreamTypeEventStreamTypeOptional EventStreamType to scope to. Defaults to All.
eventStreamIdEventStreamIdOptional EventStreamId to scope to. Defaults to Default.
eventSourceTypeEventSourceTypeOptional EventSourceType to scope to. Defaults to Default.
eventTypesIEnumerable<EventType>Optional collection of EventType to scope to. Defaults to no specific event types.