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
identifierstringThe public half of the ticket, which is what a presentation is looked up by.
userUserIdThe user the credential that reached the minting route named.
secretDigestReadOnlyMemory<byte>The digest of the secret half, which is what a presentation is compared against.
expiresAtDateTimeOffsetWhen presenting the ticket stops working.
mostOutstandingintThe most tickets the deployment holds at once, counted across every replica.
cancellationTokenCancellationTokenCancels the write.
Returns
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.