Skip to content

InMemoryEventOutbox Class

The process-local outbox: right for a single-instance transmitter and for tests. Undelivered events die with the process - a transmitter that owes durability registers a durable implementation of IEventOutbox instead.

C#
public sealed class InMemoryEventOutbox : Abblix.SharedSignals.Transmitter.IEventOutbox

Inheritance System.Object → InMemoryEventOutbox

Implements IEventOutbox

Methods

InMemoryEventOutbox.AcknowledgeAsync(string, string, IReadOnlyCollection<string>, CancellationToken) Method

Removes acknowledged SETs from a stream's queue, releasing the transmitter from retaining them (RFC 8936 Section 2.2). Identifiers with nothing to match are ignored - an acknowledgement can only arrive for something that was once here.

C#
public System.Threading.Tasks.Task AcknowledgeAsync(string receiverId, string streamId, System.Collections.Generic.IReadOnlyCollection<string> jwtIds, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

receiverId System.String

The receiver the stream belongs to.

streamId System.String

The stream whose queue is acknowledged.

jwtIds System.Collections.Generic.IReadOnlyCollection<System.String>

The "jti" values being acknowledged.

cancellationToken System.Threading.CancellationToken

Cancels I/O a durable implementation performs.

Implements AcknowledgeAsync(string, string, IReadOnlyCollection<string>, CancellationToken)

Returns

System.Threading.Tasks.Task

InMemoryEventOutbox.ClearAsync(string, string, CancellationToken) Method

Drops a stream's whole queue - the companion of deleting or disabling the stream, whose events are not held for later (SSF 1.0 Sections 8.1.1.5, 8.1.2.1).

C#
public System.Threading.Tasks.Task ClearAsync(string receiverId, string streamId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

receiverId System.String

The receiver the stream belongs to.

streamId System.String

The stream whose queue is dropped.

cancellationToken System.Threading.CancellationToken

Cancels I/O a durable implementation performs.

Implements ClearAsync(string, string, CancellationToken)

Returns

System.Threading.Tasks.Task

InMemoryEventOutbox.EnqueueAsync(string, string, OutboxItem, CancellationToken) Method

Appends a SET to a stream's queue.

C#
public System.Threading.Tasks.Task EnqueueAsync(string receiverId, string streamId, Abblix.SharedSignals.Transmitter.OutboxItem item, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

receiverId System.String

The receiver the stream belongs to.

streamId System.String

The stream the SET was minted for.

item OutboxItem

The minted SET.

cancellationToken System.Threading.CancellationToken

Cancels I/O a durable implementation performs.

Implements EnqueueAsync(string, string, OutboxItem, CancellationToken)

Returns

System.Threading.Tasks.Task

InMemoryEventOutbox.PendingAsync(string, string, Nullable<int>, CancellationToken) Method

Reads the unacknowledged head of a stream's queue, oldest first, without removing anything - redelivery of the unacknowledged is the delivery protocols' own semantics.

C#
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Abblix.SharedSignals.Transmitter.OutboxItem>> PendingAsync(string receiverId, string streamId, System.Nullable<int> maxCount=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

receiverId System.String

The receiver the stream belongs to.

streamId System.String

The stream whose queue is read.

maxCount System.Nullable<System.Int32>

The most items to return; null returns everything pending, mirroring an absent "maxEvents" (RFC 8936 Section 2.2).

cancellationToken System.Threading.CancellationToken

Cancels I/O a durable implementation performs.

Implements PendingAsync(string, string, Nullable<int>, CancellationToken)

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<OutboxItem>>