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 const fn with_run_timeout(self, timeout: Duration) -> Self
pub const fn with_run_timeout(self, timeout: Duration) -> Self
Set the run timeout
Sourcepub const fn with_idle_timeout(self, timeout: Duration) -> Self
pub const fn with_idle_timeout(self, timeout: Duration) -> Self
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
Auto Trait Implementations§
impl Freeze for TimeoutPolicy
impl !RefUnwindSafe for TimeoutPolicy
impl Send for TimeoutPolicy
impl Sync for TimeoutPolicy
impl Unpin for TimeoutPolicy
impl UnsafeUnpin for TimeoutPolicy
impl !UnwindSafe 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