pub struct Executor {
pub action_registry: Arc<RwLock<ActionRegistry>>,
pub max_parallel: usize,
pub max_retry_attempts: u32,
pub retry_base_delay: Duration,
pub retry_max_delay: Duration,
pub strict_exports: bool,
pub agent_step_executor: Option<Arc<dyn AgentStepExecutor>>,
pub action_execution_options: ActionExecutionOptions,
}Expand description
The executor - orchestrates DAG execution
Fields§
§action_registry: Arc<RwLock<ActionRegistry>>Action registry
max_parallel: usizeMaximum parallel executions
max_retry_attempts: u32Max retries for ActionResult::RetryableError (excluding initial attempt).
retry_base_delay: DurationBase delay for exponential backoff when action does not provide retry_after.
retry_max_delay: DurationCap for exponential backoff delay.
strict_exports: boolWhether declared exports are required at runtime.
agent_step_executor: Option<Arc<dyn AgentStepExecutor>>Optional runtime hook for handling agent steps.
action_execution_options: ActionExecutionOptionsOptional execution options applied to all non-agent action executions.
Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(action_registry: ActionRegistry) -> Executor
pub fn new(action_registry: ActionRegistry) -> Executor
Create a new executor
Sourcepub fn with_registry(action_registry: Arc<RwLock<ActionRegistry>>) -> Executor
pub fn with_registry(action_registry: Arc<RwLock<ActionRegistry>>) -> Executor
Create a new executor with a shared registry
Sourcepub fn with_max_parallel(self, max: usize) -> Executor
pub fn with_max_parallel(self, max: usize) -> Executor
Set maximum parallel executions
Sourcepub fn with_retry_policy(
self,
max_retry_attempts: u32,
retry_base_delay: Duration,
retry_max_delay: Duration,
) -> Executor
pub fn with_retry_policy( self, max_retry_attempts: u32, retry_base_delay: Duration, retry_max_delay: Duration, ) -> Executor
Configure retry policy for retryable action errors.
Sourcepub fn with_export_contract(self, strict_exports: bool) -> Executor
pub fn with_export_contract(self, strict_exports: bool) -> Executor
Configure strict runtime checks for step exports.
Sourcepub fn with_agent_step_executor(
self,
agent_executor: Arc<dyn AgentStepExecutor>,
) -> Executor
pub fn with_agent_step_executor( self, agent_executor: Arc<dyn AgentStepExecutor>, ) -> Executor
Configure runtime-provided executor for StepKind::Agent.
Sourcepub fn with_action_execution_options(
self,
options: ActionExecutionOptions,
) -> Executor
pub fn with_action_execution_options( self, options: ActionExecutionOptions, ) -> Executor
Configure common action execution options.
Sourcepub fn with_action_preflight_hook(
self,
hook: Arc<dyn Fn(&str, &Value) -> Option<String> + Send + Sync>,
) -> Executor
pub fn with_action_preflight_hook( self, hook: Arc<dyn Fn(&str, &Value) -> Option<String> + Send + Sync>, ) -> Executor
Configure a preflight hook for non-agent action execution.
Sourcepub async fn execute(
&self,
dag: &mut ExecutionDag,
ctx: &ExecutorContext,
) -> ExecutionResult
pub async fn execute( &self, dag: &mut ExecutionDag, ctx: &ExecutorContext, ) -> ExecutionResult
Execute a DAG
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl !UnwindSafe for Executor
impl Freeze for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more