pub struct RunnableConfig {
pub recursion_limit: u32,
pub max_concurrency: usize,
pub tags: Vec<String>,
pub metadata: Value,
pub observers: Vec<Arc<dyn Observer>>,
pub run_id: Uuid,
pub cancel_token: Option<CancellationToken>,
pub deadline: Option<Instant>,
pub extras: Extensions,
pub parent_run_id: Option<Uuid>,
}Expand description
Per-invocation configuration. Defaults are sensible; override only what you need.
Fields§
§recursion_limit: u32Maximum number of graph supersteps / chain depth before erroring with
CognisError::RecursionLimit.
max_concurrency: usizeMaximum concurrent in-flight tasks (used by batch and parallel nodes).
Free-form telemetry tags (e.g. [“production”, “feature/foo”]).
metadata: ValueUser-supplied metadata, attached to every emitted Event.
observers: Vec<Arc<dyn Observer>>Event subscribers. Multiple are allowed; each receives every event.
run_id: UuidCorrelation ID. Defaults to a fresh UUID per Default::default().
cancel_token: Option<CancellationToken>Cooperative cancellation token.
deadline: Option<Instant>Hard deadline (if set, framework checks it at every superstep boundary).
extras: ExtensionsPlugin-supplied typed payloads.
parent_run_id: Option<Uuid>Parent observation id for trace nesting. Set by composition sites
(Pipe, batch, graph engine) when invoking a sub-runnable. Defaults
to None for top-level invocations.
Implementations§
Source§impl RunnableConfig
impl RunnableConfig
Sourcepub fn with_recursion_limit(self, n: u32) -> Self
pub fn with_recursion_limit(self, n: u32) -> Self
Set the recursion limit (builder-style).
Sourcepub fn with_max_concurrency(self, n: usize) -> Self
pub fn with_max_concurrency(self, n: usize) -> Self
Set the max concurrency (builder-style).
Sourcepub fn with_observer(self, o: Arc<dyn Observer>) -> Self
pub fn with_observer(self, o: Arc<dyn Observer>) -> Self
Add a single observer (builder-style).
Sourcepub fn with_cancel_token(self, t: CancellationToken) -> Self
pub fn with_cancel_token(self, t: CancellationToken) -> Self
Set the cancellation token (builder-style).
Sourcepub fn with_parent_run_id(self, id: Uuid) -> Self
pub fn with_parent_run_id(self, id: Uuid) -> Self
Set the parent run id (builder-style). Used by composition sites to thread trace nesting down to children.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
True if the cancel token has been triggered.
Source§impl RunnableConfig
impl RunnableConfig
Sourcepub fn clone_for_subcall(parent: &Arc<RunnableConfig>) -> RunnableConfig
pub fn clone_for_subcall(parent: &Arc<RunnableConfig>) -> RunnableConfig
Build a child config for a sub-call (batch / fan-out).
Reuses tags, metadata, observers, cancel_token, deadline
— everything except a fresh run_id and an empty extras.
Trait Implementations§
Source§impl Clone for RunnableConfig
impl Clone for RunnableConfig
Source§fn clone(&self) -> RunnableConfig
fn clone(&self) -> RunnableConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more