ExecutionConfig

Struct ExecutionConfig 

Source
pub struct ExecutionConfig {
    pub max_concurrency: usize,
    pub default_timeout: Duration,
    pub max_retries: u32,
    pub initial_retry_delay: Duration,
    pub max_retry_delay: Duration,
    pub idempotency_ttl: Duration,
    pub enable_idempotency: bool,
}
Expand description

Configuration for tool execution behavior.

This struct controls all aspects of how tools are executed by the ToolWorker, including retry behavior, timeouts, concurrency limits, and idempotency settings.

§Examples

use riglr_core::ExecutionConfig;
use std::time::Duration;

// Default configuration
let config = ExecutionConfig::default();

// Custom configuration for high-throughput scenario
let high_throughput_config = ExecutionConfig {
    max_concurrency: 50,
    default_timeout: Duration::from_secs(120),
    max_retries: 5,
    initial_retry_delay: Duration::from_millis(200),
    max_retry_delay: Duration::from_secs(60),
    enable_idempotency: true,
    ..Default::default()
};

// Conservative configuration for sensitive operations
let conservative_config = ExecutionConfig {
    max_concurrency: 5,
    default_timeout: Duration::from_secs(300),
    max_retries: 1,
    initial_retry_delay: Duration::from_secs(5),
    max_retry_delay: Duration::from_secs(30),
    enable_idempotency: true,
    ..Default::default()
};

Fields§

§max_concurrency: usize

Maximum number of concurrent executions per resource type.

This controls the default concurrency limit when no specific resource limit is configured. Individual resource types can have their own limits configured via ResourceLimits.

Default: 10

§default_timeout: Duration

Default timeout for tool execution.

Individual tool executions will be cancelled if they exceed this duration. Tools should be designed to complete within reasonable time bounds.

Default: 30 seconds

§max_retries: u32

Maximum number of retry attempts for failed operations.

This applies only to retriable failures. Permanent failures are never retried. The total number of execution attempts will be max_retries + 1.

Default: 3 retries (4 total attempts)

§initial_retry_delay: Duration

Initial retry delay for exponential backoff.

The first retry will wait this long after the initial failure. Subsequent retries will use exponentially increasing delays.

Default: 100 milliseconds

§max_retry_delay: Duration

Maximum retry delay for exponential backoff.

Retry delays will not exceed this value, even with exponential backoff. This prevents excessive wait times for highly retried operations.

Default: 10 seconds

§idempotency_ttl: Duration

TTL for idempotency cache entries.

Completed operations with idempotency keys will be cached for this duration. Subsequent requests with the same key will return the cached result.

Default: 1 hour

§enable_idempotency: bool

Whether to enable idempotency checking.

When enabled, jobs with idempotency keys will have their results cached and subsequent identical requests will return cached results instead of re-executing the tool.

Default: true

Trait Implementations§

Source§

impl Clone for ExecutionConfig

Source§

fn clone(&self) -> ExecutionConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecutionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExecutionConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,