pub struct TaskExecutor { /* private fields */ }Expand description
Handles the execution of tasks with their associated functions.
The TaskExecutor is responsible for:
- Routing async functions (http_call, enrich, publish_kafka, custom) to
the matching registered handler via [
crate::engine::functions::DynAsyncFunctionHandler] - Owning the function registry
Sync built-ins are not routed through execute — workflow_executor
calls FunctionConfig::try_execute_in_arena inside its sync stretch
for those, sharing one arena across consecutive sync tasks.
Implementations§
Source§impl TaskExecutor
impl TaskExecutor
Sourcepub fn new(
task_functions: Arc<HashMap<String, BoxedFunctionHandler>>,
engine: Arc<Engine>,
) -> Self
pub fn new( task_functions: Arc<HashMap<String, BoxedFunctionHandler>>, engine: Arc<Engine>, ) -> Self
Create a new TaskExecutor
Sourcepub async fn execute(
&self,
task: &Task,
message: &mut Message,
) -> Result<(TaskOutcome, Vec<Change>)>
pub async fn execute( &self, task: &Task, message: &mut Message, ) -> Result<(TaskOutcome, Vec<Change>)>
Execute a single task. Sync built-ins reach here only when called from
outside the workflow executor’s sync-stretch path — they fall back to
their execute() methods (which open a fresh thread-local arena).
Sourcepub fn has_function(&self, name: &str) -> bool
pub fn has_function(&self, name: &str) -> bool
Check if a function handler exists
Sourcepub fn task_functions(&self) -> Arc<HashMap<String, BoxedFunctionHandler>>
pub fn task_functions(&self) -> Arc<HashMap<String, BoxedFunctionHandler>>
Get a clone of the task_functions Arc for reuse in new engines
Sourcepub fn custom_function_count(&self) -> usize
pub fn custom_function_count(&self) -> usize
Get the count of registered custom functions
Auto Trait Implementations§
impl Freeze for TaskExecutor
impl !RefUnwindSafe for TaskExecutor
impl Send for TaskExecutor
impl Sync for TaskExecutor
impl Unpin for TaskExecutor
impl UnsafeUnpin for TaskExecutor
impl !UnwindSafe for TaskExecutor
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