pub struct ChainExecutor { /* private fields */ }Expand description
High-performance executor for automation chains.
Features:
- Parallel execution of independent steps
- Response caching with TTL
- Configurable concurrency limits
- Progress tracking and cancellation
Implementations§
Source§impl ChainExecutor
impl ChainExecutor
Sourcepub fn with_concurrency(max_concurrency: usize) -> Self
pub fn with_concurrency(max_concurrency: usize) -> Self
Create with custom concurrency limit.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set step timeout.
Sourcepub fn with_cache(self, enabled: bool) -> Self
pub fn with_cache(self, enabled: bool) -> Self
Enable or disable caching.
Sourcepub fn max_concurrency(&self) -> usize
pub fn max_concurrency(&self) -> usize
Get the maximum concurrency limit.
Sourcepub async fn execute<F, Fut>(
&self,
steps: Vec<ChainStep>,
context: ChainContext,
step_fn: F,
) -> ChainResultwhere
F: Fn(ChainStep, ChainContext) -> Fut + Clone + Send + Sync + 'static,
Fut: Future<Output = ChainStepResult> + Send,
pub async fn execute<F, Fut>(
&self,
steps: Vec<ChainStep>,
context: ChainContext,
step_fn: F,
) -> ChainResultwhere
F: Fn(ChainStep, ChainContext) -> Fut + Clone + Send + Sync + 'static,
Fut: Future<Output = ChainStepResult> + Send,
Execute a chain of steps.
Steps are analyzed for dependencies and independent steps are executed in parallel where possible.
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear the response cache.
Trait Implementations§
Source§impl Debug for ChainExecutor
impl Debug for ChainExecutor
Auto Trait Implementations§
impl Freeze for ChainExecutor
impl !RefUnwindSafe for ChainExecutor
impl Send for ChainExecutor
impl Sync for ChainExecutor
impl Unpin for ChainExecutor
impl UnsafeUnpin for ChainExecutor
impl !UnwindSafe for ChainExecutor
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