Class JobRecurrence
- Namespace
- MailFathom.Application.Jobs.Scheduling
- Assembly
- MailFathom.Application.dll
States when a recurring dispatch happens, in the two shapes a deployment writes and this system owns.
public sealed class JobRecurrence
- Inheritance
-
JobRecurrence
- Inherited Members
Remarks
The syntax is MailFathom's own rather than cron, and that is a decision rather than an omission. The platform ships no cron parser, so cron would be a package to review, pin, and record in the licensing register — bought for the cases nobody has asked for. What a recurring rule pass actually needs is an interval and a time of day, and both are stated here in words an operator reads back without a reference card.
Two forms, and nothing else parses:
Every <interval> |
A fixed period written as hh:mm:ss or d.hh:mm:ss, at least MinimumInterval and at most
MaximumInterval. Its occasions are anchored to the Unix epoch rather than to the last dispatch, so
they are the same instants on every replica and do not drift by however long a pass took to notice one.
|
Daily at <HH:mm> [<time zone>] |
One occasion a day at that wall-clock time. Without a zone the time is UTC; naming a zone — an IANA
identifier such as Europe/Warsaw — reads the time in it, daylight saving included.
|
A local time meets two cases a UTC one never does, and both are resolved here rather than left to whichever instant arithmetic happens to produce. A time the clock skips over when it springs forward does not occur at all, and is taken as the instant the gap ends, so the day's occasion still happens rather than being lost. A time the clock passes through twice when it falls back occurs twice, and the first of the two is taken, so the occasion happens once and at the earlier of the two readings.
Fields
- MaximumInterval
The longest interval a deployment may declare.
- MinimumInterval
The shortest interval a deployment may declare.
Properties
- CanonicalForm
Gets the declaration in the one form two recurrences are compared and hashed by.
Methods
- CountOccurrencesIn(DateTimeOffset, DateTimeOffset)
Counts the occasions that fall in a window, which is how many a dispatch is passing over.
- LatestOccurrenceAtOrBefore(DateTimeOffset)
Reads the most recent occasion at or before an instant.
- NextOccurrenceAfter(DateTimeOffset)
Reads the first occasion strictly after an instant.
- ToString()
Returns a string that represents the current object.
- TryParse(string?, out JobRecurrence?, out string?)
Reads a declared schedule, reporting what is wrong with one this system cannot use.