Skip to main content

Module call

Module call 

Source
Expand description

A Drone block: a step that is another drone (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.5).

The callee runs inside the caller’s run, on the caller’s remaining budget and under its cancel, so it cannot spend more than the run that called it and stopping the run stops it. It is a child run with an id of its own, announced by ChildStarted and ChildEnded; it keeps no checkpoints of its own, because the block is a step with effects (the callee may do anything): a restart that finds it running asks what to do with it, as for any such step. What the callee’s Response says is the block’s value, and it is outside text (tainted): the boundary does not yet promise any value is clean.

A drone cannot call itself, directly or through the drones it calls, and calls nest at most MAX_DEPTH deep.

Structs§

LateInner 🔒
LateSpend 🔒
Callees whose call was given up on: they were stopped, but are still ending, and what they spent in the meantime is the caller’s.
StopWith 🔒
Stops the callee when the call is dropped, and when the caller is stopped.

Constants§

MAX_DEPTH 🔒
The deepest a chain of calls may go, the first drone counted.
MAX_INPUT_BYTES 🔒
What the callee may be given, as JSON: the same limit as a run’s own input.
SETTLE_LIMIT 🔒
The most the caller waits for callees it stopped to end.

Functions§

add_cost 🔒
Put spent on a block’s state as its cost_usd, which is what the run’s ledger row sums.
remaining_cap 🔒
What a callee may spend: what its caller has left of its cap, none when there is no cap.
say_waits 🔒
What a callee’s events say to its caller: when it waits (and for what, with the key that ends a wait on an event) and when the wait is over, put on the calling block, so the caller’s run shows it waits and resumedronewait can be given the key. Nothing else of the callee’s is passed on: its end is ChildEnded, and a RunDone of its own would end the caller’s stream. A callee stopped in the middle of a wait never says it ended, so that is said when its events stop.