ScheduleModule
PackageFCQRS.Workflows
The schedule aggregate's rules. One aggregate instance holds one schedule.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| EntityName | EntityName | The aggregate's entity name. |
| initial | initial | The state before the schedule's first event. |
| OnTimeWindow | OnTimeWindow | How late a `Fire` may arrive for a due time and still be on time under `CatchUp.None`: one minute. |
| EarlyTolerance | EarlyTolerance | How early a `Fire` may arrive for a due time: one second, which covers timer imprecision. |
| allowedDue | allowedDue state now | The one due time a `Fire` arriving at `now` may name, or nothing for a schedule that does not exist, is deleted or is paused. |
| decide | decide command state | Chooses what to do with a command. |
| fold | fold event state | Applies one event. |
How late a `Fire` may arrive for a due time and still be on time under `CatchUp.None`: one
minute. A due time more than a minute old when its `Fire` arrives was missed, and
`CatchUp.None` skips it. For a rule whose due times are less than a minute apart, a gap
shorter than a minute therefore runs its latest due time, as `CatchUp.Latest` does.
Returns
TimeSpan
How early a `Fire` may arrive for a due time: one second, which covers timer imprecision. A
`Fire` that arrives earlier is refused and changes nothing, so a dispatcher fault cannot
start a run more than a second early. The same due time is accepted when its time comes.
Returns
TimeSpan
The one due time a `Fire` arriving at `now` may name, or nothing for a schedule that does not
exist, is deleted or is paused. It is the next due time after the last accepted one, the
creation, the last change and the last resume. When that due time has already passed, the
catch-up policy chooses among the passed ones: `Latest` the most recent, `All` the oldest of
the most recent `ScheduleRule.MaxMissed`, and `None` the most recent if it passed within
`OnTimeWindow`, otherwise the next due time after `now`. The result can be later than `now`:
`decide` accepts it only from `EarlyTolerance` before it. A pending `Firing` is not checked here.
Parameters
| Name | Type | Description |
|---|---|---|
| state | ScheduleState | |
| now | DateTime |
Returns
DateTime option
Chooses what to do with a command. The command's `CreationDate` is the current time. A
refusal is a deferred `Refused`. A repeat of an accepted command is answered with a deferred
copy of the first verdict, checked before anything the first command changed. A spec that
fails validation, or a due time that cannot be computed, is refused: decide raises nothing.
Parameters
| Name | Type | Description |
|---|---|---|
| command | Command<ScheduleCommand> | |
| state | ScheduleState |
Returns
EventAction<ScheduleEvent>