Interface IRecurringSendStore
- Namespace
- MailFathom.Application.Mail.Delivery.Scheduling
- Assembly
- MailFathom.Application.dll
Keeps every declaration that a message is sent again on the occasions a schedule names.
public interface IRecurringSendStore
Remarks
A declaration is state rather than settings, which is why it is here and not in the deployment's configuration. What repeats is a message somebody wrote, at a moment they chose, and it is stopped by them as well — none of which an operator's file can hold, and all of which the database can.
The idempotency identity is the sending account and the authoring act together, exactly as an outgoing record's is, and it is enforced by a unique constraint rather than by this contract declining to write. A caller that retried a command reads back the declaration it already made instead of declaring a second one that would send everything twice.
Writes take the caller's session, because a declaration and the draft its occasions are composed from are one write: a declaration whose draft was never stored describes occasions that can produce no message, and a draft under no declaration is bytes nothing will ever read.
Methods
- CancelAsync(IPersistenceSession, RecurringSendId, CancellationToken)
Stops a declaration from producing any further occurrence.
- DeclareAsync(IPersistenceSession, RecurringSendRequest, long, CancellationToken)
Writes the declaration down, or reads back the one that already holds this idempotency identity.
- FindAsync(RecurringSendId, CancellationToken)
Reads one declaration back by the identifier its occasions and its cancellation name it by.
- ReadActiveAsync(int, CancellationToken)
Reads what the dispatch needs about the declarations that still produce occurrences.
- RecordOccurrenceAsync(IPersistenceSession, RecurringSendId, DateTimeOffset, OutgoingEmailId, CancellationToken)
Records the occasion a declaration has now produced a message for.