Interface IIdempotentRepository

Assembly: redb.Route.dll

Repository that tracks message identifiers for idempotent consumption.
Implementations may use in-memory stores, Redis, or a database.

public interface IIdempotentRepository

Properties

JoinsAmbientTransaction

Whether writes through an ambient , so that its

bool JoinsAmbientTransaction { get; }

Methods

Add(string, CancellationToken)

Attempts to add the key. Returns true if the key was new (not a duplicate).

Task<bool> Add(string key, CancellationToken ct = default)

Claim(string, TimeSpan?, CancellationToken)

Claims the key as does, and when it is held already tells why: the message is still being

Task<IdempotentClaim> Claim(string key, TimeSpan? abandonedAfter, CancellationToken ct = default)

Clear(CancellationToken)

Removes all keys from the repository.

Task Clear(CancellationToken ct = default)

Confirm(string, CancellationToken)

Confirms the key after successful processing.

Task Confirm(string key, CancellationToken ct = default)

Confirm(string, string?, CancellationToken)

Confirms the claim token names (from ) after successful processing. Returns

Task<bool> Confirm(string key, string? token, CancellationToken ct = default)

Contains(string, CancellationToken)

Checks if the key already exists in the repository.

Task<bool> Contains(string key, CancellationToken ct = default)

Lease(string, TimeSpan?, CancellationToken)

that also names the claim it took: identifies this claim of

Task<IdempotentLease> Lease(string key, TimeSpan? abandonedAfter, CancellationToken ct = default)

Release(string, string?, CancellationToken)

Removes the claim token names (from ), so the message can be processed again.

Task<bool> Release(string key, string? token, CancellationToken ct = default)

Remove(string, CancellationToken)

Removes the key, allowing it to be reprocessed.

Task Remove(string key, CancellationToken ct = default)