Expand description
Timeout enforcement for graph node execution.
Provides wall-clock and idle timeout enforcement for individual graph nodes, with configurable recovery actions (fail, retry, skip).
§Overview
The TimeoutPolicy struct configures timeout behavior for a node:
run_timeout: Hard wall-clock limit from when the node starts executing.idle_timeout: Resets each time [report_progress()] is called on the progress handle.on_timeout: What to do when a timeout fires (OnTimeout).
§Example
ⓘ
use std::time::Duration;
use adk_graph::timeout::{TimeoutPolicy, OnTimeout};
let policy = TimeoutPolicy {
run_timeout: Some(Duration::from_secs(30)),
idle_timeout: Some(Duration::from_secs(5)),
on_timeout: OnTimeout::Retry { max_attempts: 3 },
};Structs§
- Progress
Handle - A shared progress handle that nodes can use to report progress, resetting the idle timeout counter.
- Timeout
Policy - Timeout configuration for a graph node.
Enums§
- OnTimeout
- Recovery action when a node times out.
Functions§
- execute_
with_ timeout - Execute a node with timeout enforcement.