Skip to main content

Module engine

Module engine 

Source
Expand description

A run’s handle, its event stream and the way to stop it. The scheduler that runs the graph is scheduler.rs.

Structs§

Cancel
How a run is stopped: a flag the scheduler looks at before each block and that ends the block in flight, with the reason it was set for.
RunHandle

Enums§

RunEnd 🔒
How the scheduler ended a run that did not finish.
RunEvent
Streaming events emitted to the frontend during a run.

Functions§

cancel_run
Stop the run run_id for reason (a Drone run, not a ledger row). The block in flight ends, an Agent block’s process with it, and the run ends cancelled. false when no such run is going.
end_event 🔒
The event that closes a run’s stream, from how it ended.
mark_state 🔒
replay_drone
Start the run that replays an earlier one: first is its first checkpoint (replay::fork_checkpoint), on graph, the graph the earlier run was on. It is a run of its own, with its own id and checkpoints; the blocks that were finished at the step it starts from are not run again, and a block with effects says what it said before instead of doing it again unless replay.fork.real.
resume_drone
Take a run up again after AgentMux restarted: from checkpoint, its newest, on graph, the graph the checkpoint was written on. The blocks that were done are not run again, and what they said is what the rest reads. The run goes on under the same id, keeps writing checkpoints through persist, and ends as any run does. checkpoint.run_id names it.
run_drone
Run the drone end-to-end. Returns a handle whose events channel surfaces per-block lifecycle, and a final_states mutex callers can snapshot for the run-history record. trigger is what started the run ({{trigger.*}}); Null when nothing did. run_cap_usd ends the run before its next block once its Agent blocks have spent that much (a job’s per-run cap); None is no cap, as for a run started by hand. persist says where to keep the run’s checkpoints; None keeps none.