Timer
One schedule of an aggregate: send the command of type commandType, body its JSON, to target each time rule says, the next time dueAt (epoch milliseconds), for its slot, due at slotDueAt.
id is
ref#key@version, its names escaped, the schedule as the owner's stream at version set it (Timers.idOf); the command of each slot is sent with the request idid#slot(requestId), so sending it again is deduplicated by its target.owner and key name the schedule: the aggregate that set it (Timers.ownerOf), compared field by field, never by its joined name, so two aggregates whose tenant and id join alike keep their timers apart; version orders the owner's changes (TimerStore).
slot counts the times the schedule is due, from 1: firing a slot marks it fired and moves dueAt to the next one in one write; a rule due once has one slot, after which the timer is FIRED. A recurring rule's slot is the number of its times since it was set, so slots it skipped (missed and coalesced, me.ahoo.wow.api.schedule.Misfire) are counted too: skipped is how many slots before this one were not sent.
slotDueAt is when the current slot is due, as its rule said; dueAt is when the firing loop next looks at the timer: the slot's due time at first, then the claim's deadline while it is sent, or the next attempt after a technical failure. Every send of the slot, retried or claimed anew, carries slotDueAt (context), so its target never decides it before then; it moves only with the slot.
partition is the partition of the owner among its context's log partitions: the owner of that partition writes the timer from the owner's events and fires it, and a sharded store shards the timers by it, so the due read and every read or write by owner reach one shard. The command reaches a target owned elsewhere through the cluster channel.
causation links the command to the commit that set the schedule; headers and operator are the setting command's, which the command inherits, and scope the setting commit's, the owner and space the command is sent in.
status, attempts and outcome record what the firing loop did: outcome is what the target answered (TimerOutcomes), or why a timer is parked.
Fields may be added: construct one with of; the constructor is internal to Wow.
Constructors
Properties
Functions
This Timer with the given fields replaced: Wow's own copy, left out of the ABI.