Method RemoveExpiredAsync
- Namespace
- MailFathom.Application.Access.Credentials
- Assembly
- MailFathom.Application.dll
RemoveExpiredAsync(DateTimeOffset, CancellationToken)
Forgets the identifiers whose assertions can no longer be presented.
Task RemoveExpiredAsync(DateTimeOffset removableFrom, CancellationToken cancellationToken)
Parameters
removableFromDateTimeOffsetThe instant an assertion's expiry is judged against: a record is dropped once its
removableFromhas passed its recorded expiry. It is the caller's, not the clock's, because whoever verifies an assertion decides how long past its own expiry it is still accepted — a caller tolerating clock skew subtracts that tolerance here, since dropping the record of an assertion still being accepted is what would admit the replay.cancellationTokenCancellationTokenCancels the removal.
Returns
- Task
A task that completes when the expired records are gone.
Remarks
Bounded by what it can match rather than by a limit the caller passes: an implementation reaches the expired records through an ordering on the expiry, so the work is proportional to what has expired since the last removal rather than to everything ever spent.
Exceptions
- ClientAssertionSpendUnrecordableException
Thrown when the removal could not run, which reaches the request that triggered it rather than being swallowed.