pub struct ExecutorContext {
pub working_set: Arc<RwLock<WorkingSet>>,
pub workflow_id: WorkflowId,
pub cancellation_token: CancellationToken,
pub progress_reporter: Option<Arc<dyn ExecutionProgressReporter>>,
pub step_execution_port: Arc<dyn StepExecutionPort>,
}Expand description
Executor context
Fields§
§working_set: Arc<RwLock<WorkingSet>>Working set for inter-step communication
workflow_id: WorkflowIdTask ID
cancellation_token: CancellationTokenRoot cancellation token for this execution.
Every action receives a child of this token so cancelling the execution is propagated without allowing one action to cancel its siblings.
progress_reporter: Option<Arc<dyn ExecutionProgressReporter>>Optional execution progress reporter.
step_execution_port: Arc<dyn StepExecutionPort>Host-owned execution boundary for this Run. It is mandatory so the DAG cannot fall back to an unguarded Action or nested Agent executor.
Implementations§
Source§impl ExecutorContext
impl ExecutorContext
Sourcepub fn new(
workflow_id: impl Into<WorkflowId>,
working_set: Arc<RwLock<WorkingSet>>,
step_execution_port: Arc<dyn StepExecutionPort>,
) -> ExecutorContext
pub fn new( workflow_id: impl Into<WorkflowId>, working_set: Arc<RwLock<WorkingSet>>, step_execution_port: Arc<dyn StepExecutionPort>, ) -> ExecutorContext
Create a new executor context
Sourcepub fn with_cancellation_token(
self,
cancellation_token: CancellationToken,
) -> ExecutorContext
pub fn with_cancellation_token( self, cancellation_token: CancellationToken, ) -> ExecutorContext
Attach the root cancellation token owned by the execution caller.
Sourcepub fn with_progress_reporter(
self,
reporter: Arc<dyn ExecutionProgressReporter>,
) -> ExecutorContext
pub fn with_progress_reporter( self, reporter: Arc<dyn ExecutionProgressReporter>, ) -> ExecutorContext
Attach a realtime execution progress reporter.
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutorContext
impl !UnwindSafe for ExecutorContext
impl Freeze for ExecutorContext
impl Send for ExecutorContext
impl Sync for ExecutorContext
impl Unpin for ExecutorContext
impl UnsafeUnpin for ExecutorContext
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.