Table of Contents

Method TryMintAsync

Namespace
MailFathom.Application.Signals
Assembly
MailFathom.Application.dll

TryMintAsync(string, UserId, ReadOnlyMemory<byte>, DateTimeOffset, int, CancellationToken)

Holds one minted ticket, unless the deployment already holds as many as it will hold.

Task<bool> TryMintAsync(string identifier, UserId user, ReadOnlyMemory<byte> secretDigest, DateTimeOffset expiresAt, int mostOutstanding, CancellationToken cancellationToken)

Parameters

identifier string

The public half of the ticket, which is what a presentation is looked up by.

user UserId

The user the credential that reached the minting route named.

secretDigest ReadOnlyMemory<byte>

The digest of the secret half, which is what a presentation is compared against.

expiresAt DateTimeOffset

When presenting the ticket stops working.

mostOutstanding int

The most tickets the deployment holds at once, counted across every replica.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<bool>

true when the ticket was held; false when the bound refused it.

Remarks

The bound is the caller's value and the deployment's count, in one statement: a count read and then written against is a bound several replicas each find room under and then all exceed.

Exceptions

ClientSignalTicketStoreUnavailableException

Thrown when the ticket could not be held, which the caller answers by refusing rather than by minting.