pub struct WorkflowExecutor { /* private fields */ }Expand description
工作流执行器
Implementations§
Source§impl WorkflowExecutor
impl WorkflowExecutor
pub fn new(config: ExecutorConfig) -> WorkflowExecutor
Sourcepub fn with_event_sender(self, tx: Sender<ExecutionEvent>) -> WorkflowExecutor
pub fn with_event_sender(self, tx: Sender<ExecutionEvent>) -> WorkflowExecutor
设置事件发送器
Sourcepub async fn register_sub_workflow(&self, id: &str, graph: WorkflowGraph)
pub async fn register_sub_workflow(&self, id: &str, graph: WorkflowGraph)
注册子工作流
Sourcepub async fn send_external_event(&self, event_type: &str, data: WorkflowValue)
pub async fn send_external_event(&self, event_type: &str, data: WorkflowValue)
发送外部事件
Sourcepub async fn execute(
&self,
graph: &WorkflowGraph,
input: WorkflowValue,
) -> Result<ExecutionRecord, String>
pub async fn execute( &self, graph: &WorkflowGraph, input: WorkflowValue, ) -> Result<ExecutionRecord, String>
执行工作流
Sourcepub async fn execute_parallel_workflow(
&self,
graph: &WorkflowGraph,
input: WorkflowValue,
) -> Result<ExecutionRecord, String>
pub async fn execute_parallel_workflow( &self, graph: &WorkflowGraph, input: WorkflowValue, ) -> Result<ExecutionRecord, String>
基于拓扑层次执行工作流 注意:由于节点包含闭包无法跨线程,这里按层次顺序执行 同一层的节点理论上可以并行,但由于闭包限制,这里顺序执行
Auto Trait Implementations§
impl Freeze for WorkflowExecutor
impl !RefUnwindSafe for WorkflowExecutor
impl Send for WorkflowExecutor
impl Sync for WorkflowExecutor
impl Unpin for WorkflowExecutor
impl UnsafeUnpin for WorkflowExecutor
impl !UnwindSafe for WorkflowExecutor
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> 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>
Converts
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>
Converts
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage