pub struct TimerWorkflow<Context, Action>{ /* private fields */ }Expand description
A timer workflow that orchestrates execution of timer nodes
Implementations§
Source§impl<Context, Action> TimerWorkflow<Context, Action>
impl<Context, Action> TimerWorkflow<Context, Action>
Sourcepub fn new(
initial_node: Arc<dyn TimerNode<Context, Action>>,
termination_action: Action,
) -> Self
pub fn new( initial_node: Arc<dyn TimerNode<Context, Action>>, termination_action: Action, ) -> Self
Create a new timer workflow with an initial node
Sourcepub fn add_node(&mut self, node: Arc<dyn TimerNode<Context, Action>>)
pub fn add_node(&mut self, node: Arc<dyn TimerNode<Context, Action>>)
Add a node to the workflow
Sourcepub fn set_route(&mut self, from_id: &NodeId, action: Action, to_id: &NodeId)
pub fn set_route(&mut self, from_id: &NodeId, action: Action, to_id: &NodeId)
Set a route from one node to another based on an action
Sourcepub async fn execute(&self, ctx: &mut Context) -> Result<(), FloxideError>
pub async fn execute(&self, ctx: &mut Context) -> Result<(), FloxideError>
Execute the workflow until completion or error
Auto Trait Implementations§
impl<Context, Action> Freeze for TimerWorkflow<Context, Action>where
Action: Freeze,
impl<Context, Action> !RefUnwindSafe for TimerWorkflow<Context, Action>
impl<Context, Action> Send for TimerWorkflow<Context, Action>
impl<Context, Action> Sync for TimerWorkflow<Context, Action>
impl<Context, Action> Unpin for TimerWorkflow<Context, Action>where
Action: Unpin,
impl<Context, Action> !UnwindSafe for TimerWorkflow<Context, Action>
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