pub struct TimeoutPolicy {
pub run_timeout: Duration,
pub idle_timeout: Option<Duration>,
pub refresh_on: Option<Arc<dyn Fn(&Value) -> bool + Send + Sync>>,
}Expand description
Node-level timeout policy
Prevents LLM calls or tool execution from blocking indefinitely. Configured per-node through the graph builder.
§Examples
ⓘ
use juncture_core::pregel::context::TimeoutPolicy;
use std::time::Duration;
let policy = TimeoutPolicy::default()
.with_run_timeout(Duration::from_secs(60));Fields§
§run_timeout: DurationMaximum runtime for a single execution
idle_timeout: Option<Duration>Idle timeout: if no progress signal within this time, consider timed out
refresh_on: Option<Arc<dyn Fn(&Value) -> bool + Send + Sync>>Progress signal detector (refreshes idle_timeout on heartbeat)
Receives a serializable event representation containing event type and node name.
Implementations§
Source§impl TimeoutPolicy
impl TimeoutPolicy
Sourcepub fn new() -> TimeoutPolicy
pub fn new() -> TimeoutPolicy
Create a new timeout policy with defaults
Sourcepub const fn with_run_timeout(self, timeout: Duration) -> TimeoutPolicy
pub const fn with_run_timeout(self, timeout: Duration) -> TimeoutPolicy
Set the run timeout
Sourcepub const fn with_idle_timeout(self, timeout: Duration) -> TimeoutPolicy
pub const fn with_idle_timeout(self, timeout: Duration) -> TimeoutPolicy
Set the idle timeout
Trait Implementations§
Source§impl Clone for TimeoutPolicy
impl Clone for TimeoutPolicy
Source§fn clone(&self) -> TimeoutPolicy
fn clone(&self) -> TimeoutPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimeoutPolicy
impl Debug for TimeoutPolicy
Source§impl Default for TimeoutPolicy
impl Default for TimeoutPolicy
Source§fn default() -> TimeoutPolicy
fn default() -> TimeoutPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TimeoutPolicy
impl !UnwindSafe for TimeoutPolicy
impl Freeze for TimeoutPolicy
impl Send for TimeoutPolicy
impl Sync for TimeoutPolicy
impl Unpin for TimeoutPolicy
impl UnsafeUnpin for TimeoutPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more