pub struct RunHandle { /* private fields */ }Expand description
Controls a running run. Cheap to clone, Send + Sync.
Implementations§
Source§impl RunHandle
impl RunHandle
Sourcepub fn abort(&self, reason: impl Into<String>)
pub fn abort(&self, reason: impl Into<String>)
Cancel immediately: in-flight nodes are dropped. Ends with RunAborted.
Sourcepub fn pause(&self, reason: impl Into<String>)
pub fn pause(&self, reason: impl Into<String>)
Stop scheduling new nodes, let in-flight nodes finish, then end with RunPaused
(or RunSucceeded if nothing was left to run).
Sourcepub fn pause_with(&self, reason: PauseReason)
pub fn pause_with(&self, reason: PauseReason)
RunHandle::pause with a caller-chosen reason (reported in RunPaused).
Sourcepub fn preempt(&self, reason: impl Into<String>)
pub fn preempt(&self, reason: impl Into<String>)
Stop now: cancel in-flight nodes (dropping their futures), then end with
RunPaused. A cancelled node is saved as pending and runs again on resume,
with the same exec_id and attempt number, so execution is at-least-once
per node: hosts should key side effects on run_id + exec_id. Container
bodies are preempted too and resume where they stopped. Escalates an
earlier RunHandle::pause. Use it when the host cannot wait for nodes to
finish (a shutdown grace period shorter than an LLM call).
Sourcepub fn preempt_with(&self, reason: Option<PauseReason>)
pub fn preempt_with(&self, reason: Option<PauseReason>)
RunHandle::preempt with a caller-chosen reason, or none to escalate an
earlier pause without reporting a second reason.
Sourcepub fn update_variable(&self, selector: Selector, value: Value)
pub fn update_variable(&self, selector: Selector, value: Value)
Write a variable into the root frame (applied between node completions).