Interface IClientSignalTicketStore
- Namespace
- MailFathom.Application.Signals
- Assembly
- MailFathom.Application.dll
Where the deployment holds the unspent tickets its signal connections are opened against.
public interface IClientSignalTicketStore
Remarks
The port exists because a ticket is minted by whichever replica answered the minting route and presented to whichever replica answered the connection, and nothing routes the two together: the connection skips negotiation, so it is one request the load balancer places on its own. A ticket held in a process is therefore redeemable about one time in the replica count, which is a live channel that silently stops working when an operator scales out. ADR 0032 records that and why the ticket does not live in the optional backplane instead.
What is held is a user, a digest of the secret half, and when the ticket stops being presentable. The secret itself never reaches the store, so a row read out of the database or out of a backup is not a ticket.
Methods
- RedeemAsync(string, CancellationToken)
Spends one ticket, reporting what it held.
- RemoveExpiredAsync(DateTimeOffset, CancellationToken)
Forgets the tickets that can no longer be presented.
- TryMintAsync(string, UserId, ReadOnlyMemory<byte>, DateTimeOffset, int, CancellationToken)
Holds one minted ticket, unless the deployment already holds as many as it will hold.