pub struct WorkflowExecutor { /* private fields */ }Implementations§
Source§impl WorkflowExecutor
impl WorkflowExecutor
Sourcepub fn new(id: impl Into<String>, workflow: Workflow) -> WorkflowExecutor
pub fn new(id: impl Into<String>, workflow: Workflow) -> WorkflowExecutor
Wrap workflow as an executor with the given id.
By default the child’s outputs are sent onward as messages from this
node. Use WorkflowExecutor::with_direct_output to instead yield them
directly as parent workflow outputs.
Sourcepub fn with_direct_output(self, allow: bool) -> WorkflowExecutor
pub fn with_direct_output(self, allow: bool) -> WorkflowExecutor
Yield the child’s outputs directly to the parent’s output stream instead of forwarding them as messages.
Trait Implementations§
Source§impl Executor for WorkflowExecutor
impl Executor for WorkflowExecutor
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
message: Value,
ctx: WorkflowContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
WorkflowExecutor: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
message: Value,
ctx: WorkflowContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
WorkflowExecutor: 'async_trait,
Handle an incoming message.
Source§fn snapshot_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn snapshot_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Capture serializable state for checkpointing. Read more
Source§fn restore_state<'life0, 'async_trait>(
&'life0 self,
_state: Value,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn restore_state<'life0, 'async_trait>(
&'life0 self,
_state: Value,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Restore state previously produced by
Executor::snapshot_state. Read moreSource§fn reset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn reset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Reset per-run state before a fresh run (upstream
IResettableExecutor):
an executor instance is shared by every run of its workflow, so one
that keeps per-run state clears it here. Called on every executor at
the start of a run (not on a resume from a checkpoint). The default
does nothing.Source§fn describe_protocol(&self) -> ProtocolDescriptor
fn describe_protocol(&self) -> ProtocolDescriptor
The message types this executor accepts, sends and yields (upstream
DescribeProtocol). Payloads here are JSON, so types are names the
workflow’s author chooses (or JSON type names). The default accepts
anything and declares nothing.Source§fn request_port(&self) -> Option<RequestPortInfo>
fn request_port(&self) -> Option<RequestPortInfo>
For a request port (a node that hands requests to the caller), its
request and response type names;
None for other executors.Auto Trait Implementations§
impl !Freeze for WorkflowExecutor
impl !RefUnwindSafe for WorkflowExecutor
impl !UnwindSafe for WorkflowExecutor
impl Send for WorkflowExecutor
impl Sync for WorkflowExecutor
impl Unpin for WorkflowExecutor
impl UnsafeUnpin 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