Table of Contents

Interface IEventsQueue

Namespace
ReflectionEventing.Queues
Assembly
ReflectionEventing.dll

Defines a contract for an event queue that supports asynchronous operations for appending and retrieving events.

public interface IEventsQueue

Methods

EnqueueAsync<TEvent>(TEvent, CancellationToken)

Appends an event to the queue asynchronously.

Task EnqueueAsync<TEvent>(TEvent @event, CancellationToken cancellationToken = default) where TEvent : class

Parameters

event TEvent

The event to append to the queue.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous append operation.

Type Parameters

TEvent

EnqueueError(FailedEvent)

Appends a failed event to the error queue.

void EnqueueError(FailedEvent fail)

Parameters

fail FailedEvent

The failed event to append to the error queue.

GetErrors()

Gets the events that failed processing from the error queue.

IEnumerable<FailedEvent> GetErrors()

Returns

IEnumerable<FailedEvent>

An IEnumerable<T> of events that failed processing.

ReadEventsAsync(CancellationToken)

Reads the events from the queue asynchronously.

IAsyncEnumerable<object> ReadEventsAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

IAsyncEnumerable<object>

An IAsyncEnumerable<T> of events from the queue.