Method TryMintAsync
- Namespace
- MailFathom.Application.Access.Sessions
- Assembly
- MailFathom.Application.dll
TryMintAsync(MintedClientSessionRow, ClientSessionGrant, int, CancellationToken)
Holds a new session for what a credential admitted, while the user and the credential behind it still admit one and the deployment is under its own bound.
Task<ClientSessionMintOutcome> TryMintAsync(MintedClientSessionRow row, ClientSessionGrant grant, int mostLiveSessions, CancellationToken cancellationToken)
Parameters
rowMintedClientSessionRowThe identifier, the digest, and the expiry the caller drew for this session.
grantClientSessionGrantWhat the exchange established, which the session admits until it is renewed, revoked, or expires.
mostLiveSessionsintThe most sessions the deployment holds at once, counted by the statement that writes this one.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<ClientSessionMintOutcome>
Whether the session is held, and where it is not, which of the two refusals it was.
Remarks
It takes the user row and then the credential row before it writes, in that order and holding both until it commits, which is what makes an operator's act order against an exchange in flight rather than race it. The order is the same one an erasure takes by construction, so what a contending pair costs is a wait rather than one of the two being aborted.
Exceptions
- ClientSessionStoreUnavailableException
Thrown when the sessions could not be reached, which the caller answers as unavailable rather than by minting a session nothing holds.