pub enum Parallel {
Opening {
id: String,
job_channel: Sender<Message>,
position: usize,
},
Closing {
id: String,
job_channel: Sender<Message>,
position: usize,
dependencies: AtomicUsize,
dependencies_met: AtomicUsize,
},
}
Expand description
Parallel node concrete type
Contains two variants, Opening
and Closing
, this is because each one behaves in a different
way when run. The Closing
variant of a parallel must hold execution until all pointers into it
have been resolved whereas an Opening
variant does nothing.
Variants§
Opening
No special behaviour required for Opening, simply completes with no bespoke behaviour
Closing
Keeps track of how many times it is pointed to and how many times it has been run. We can
only proceed once it has been run as many times as it has pointers to it. The
dependencies_met
count is reset every time the node completes, this is in case we loop
back to this node
Trait Implementations§
Source§impl Node for Parallel
impl Node for Parallel
Source§fn kind(&self) -> WorkflowNodeType
fn kind(&self) -> WorkflowNodeType
Return the type of node, this is used for easily locating the Start and End nodes
Source§fn position(&self) -> usize
fn position(&self) -> usize
A pointer to the current nodes position in the
Job.nodes
collectionSource§fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), NodeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), NodeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The publicly exposed API for running a node
Auto Trait Implementations§
impl !Freeze for Parallel
impl !RefUnwindSafe for Parallel
impl Send for Parallel
impl Sync for Parallel
impl Unpin for Parallel
impl !UnwindSafe for Parallel
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