Module run
Expand description
The per-run journal machine.
Workflow code is deterministic between journal operations. Every operation
the code starts (step, sleep, wait_for, child, now, …) takes the
next sequence number, so an operation’s identity is the order in which the
code called it. Results come back as deliveries, and the journal
records deliveries in the order they were handed to the code. Replay hands
recorded results back in exactly that order, one at a time, letting the
code run until it is quiescent in between. Live completions that arrive
while replay is still in progress are held until the recorded ones are all
delivered. Live execution uses the same one-at-a-time rule, so a parallel
branch can never observe a different interleaving after a crash.
Accepted updates are deliveries too: an update’s handler starts at the update’s place in the journal, so its operations take the same sequence numbers on every run.
The machine does no I/O. It tells the host which records to append and when a step function may run; the host (the embedded engine, a language binding or a remote worker) does the rest.
Structs§
- Determinism
Error - The code did something its journal says it did not do the first time.
- Outcome
- What an operation resolves to.
- RunInfo
- Identity and input of a run, from its
Startrecord. - RunMachine
- Stream
Open - What
RunMachine::stream_opentells the writer.
Enums§
- Arm
- What the host must do after the code starts a sleep, wait or child.
- Await
Start - What the host must do after the code starts an async completion.
- Completion
- A live completion reported by the host.
- Live
Record - The record of a
Next::DeliverLive, less what its outcome holds. - Next
- The next thing to hand to the code.
- OpKind
- The kinds of journal operations workflow code can start.
- Step
Start - What the host must do after the code starts a step.
Functions§
- empty
- The empty payload, shared on this thread (a clone, not an allocation).