Class OrderedEventProcessor
Provides an event processor that ensures events are processed sequentially in the order they are received.
public sealed class OrderedEventProcessor : IAsyncDisposable, IDisposable
- Inheritance
-
OrderedEventProcessor
- Implements
- Inherited Members
Methods
Dispose()
Disposes the ordered event processor and its resources.
public void Dispose()
DisposeAsync()
Asynchronously disposes the ordered event processor and its resources.
public ValueTask DisposeAsync()
Returns
- ValueTask
A ValueTask representing the asynchronous dispose operation.
ProcessAsync(Func<Task>, CancellationToken)
Processes a single event asynchronously while maintaining strict ordering.
public Task ProcessAsync(Func<Task> processEvent, CancellationToken cancellationToken)
Parameters
processEventFunc<Task>A delegate to process the event.
cancellationTokenCancellationTokenA token to cancel the semaphore wait.
Returns
- Task
A task that represents the asynchronous processing operation.