Table of Contents

Interface IFencingTokenIssuer

Namespace
Excalibur.Dispatch.LeaderElection.Fencing
Assembly
Excalibur.Dispatch.LeaderElection.Abstractions.dll

Advances authoritative fencing marks, in addition to observing and validating them.

public interface IFencingTokenIssuer : IFencingTokenProvider
Inherited Members
Extension Methods

Remarks

Only providers that perform the mint implement this capability. Reading a native ownership counter is not minting. A reader need not implement this interface; callers that mint require it explicitly. This does not promise the mint and leadership acquisition share one transaction.

Methods

IssueTokenAsync(string, CancellationToken)

Atomically generates a strictly positive token greater than prior tokens for this resource.

ValueTask<long> IssueTokenAsync(string resourceId, CancellationToken cancellationToken)

Parameters

resourceId string

The nonblank protected resource identifier.

cancellationToken CancellationToken

The cancellation token to observe.

Returns

ValueTask<long>

The token generated by this operation.

Remarks

All contenders share the same resource authority and retained counter history required by IFencingTokenProvider. Store/consistency faults propagate without conversion to an absent mark; caller cancellation is honored before store access. Minting generates a mark; it does not grant a lease. Growth is ordered at generation in the authoritative store, not by asynchronous return order. Concurrent mints never generate the same token. A paused response may return after a later mint. Failure or cancellation does not prove rollback: an actually generated mark may be observed by GetTokenAsync even when this call did not deliver its result. Never rewind or fabricate a mark.

Exceptions

ArgumentException

The resource identifier is null, empty or whitespace.

OperationCanceledException

Cancellation was observed.

FencingTokenExhaustedException

No strictly positive token remains; the domain never wraps.