Table of Contents

Interface IReminderSchedule

Namespace
MailFathom.Application.Reminders
Assembly
MailFathom.Application.dll

Answers which reminders of one kind have come due across the deployment, and records the ones announced.

public interface IReminderSchedule

Remarks

This is the one port here that is not one person's. A reminder comes due whether or not anybody is signed in, so what reads it is a run over the deployment rather than a request with a principal behind it — which is why the reads name no owner and why ReminderSweep is the only caller, under the process identity and under a lease.

One implementation per kind of thing that carries reminders, because each reads a table of its own and answers for its own record's rules — which reminders a completed task raises, what an all-day event is measured from. The pass holds every implementation registered and reads each in turn, which is what lets a kind be added without a producer of its own.

A reminder is announced at most once per instant it falls at, and the instant is the claim: MarkRaisedAsync(DueReminder, CancellationToken) records which one was announced rather than that something was, so a record moved to a new time has reminders that are due again on their own, and one moved back onto a time it already announced stays quiet. Nothing here holds a flag, because a flag would have to be cleared by whoever moved the record and a writer that forgot would silence the reminder for good.

Methods

MarkRaisedAsync(DueReminder, CancellationToken)

Records that one reminder was announced for the instant it currently falls at.

ReadDueAsync(DateTimeOffset, DateTimeOffset, int, CancellationToken)

Reads the reminders that have come due and have not been announced at the instant they now fall at.