Method ReadDueAsync
- Namespace
- MailFathom.Application.Reminders
- Assembly
- MailFathom.Application.dll
ReadDueAsync(DateTimeOffset, DateTimeOffset, int, CancellationToken)
Reads the reminders that have come due and have not been announced at the instant they now fall at.
Task<IReadOnlyList<DueReminder>> ReadDueAsync(DateTimeOffset asOf, DateTimeOffset notDueBefore, int limit, CancellationToken cancellationToken)
Parameters
asOfDateTimeOffsetThe instant a reminder must have fallen at or before to be due.
notDueBeforeDateTimeOffsetThe instant a reminder must have fallen at or after to still be worth announcing.
limitintThe greatest number of reminders one pass may read.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<DueReminder>>
The reminders, earliest first, and never more than
limit.
Remarks
The lower bound is what keeps a deployment that was off for a day from announcing that day's reminders the moment it comes back: a reminder nobody could have acted on is left where it is rather than delivered late in a burst, and the thing it was about has already happened.
Exceptions
- ArgumentOutOfRangeException
Thrown when
limitis not positive.