pub struct JoinNode { /* private fields */ }Expand description
A node that merges results from parallel branches.
After fan-out, parallel branches write their results to known state keys. The JoinNode reads those keys, applies a merge function, and writes the merged result to an output key.
Implementations§
Source§impl JoinNode
impl JoinNode
Sourcepub fn new(
input_keys: Vec<String>,
output_key: impl Into<String>,
merge_fn: impl Fn(Vec<(String, Value)>) -> Result<Value> + Send + Sync + 'static,
) -> Self
pub fn new( input_keys: Vec<String>, output_key: impl Into<String>, merge_fn: impl Fn(Vec<(String, Value)>) -> Result<Value> + Send + Sync + 'static, ) -> Self
Create a new JoinNode.
input_keys: state keys to collect from parallel branches.output_key: state key to write the merged result to.merge_fn: function that merges the collected values.
Trait Implementations§
Source§impl Node for JoinNode
impl Node for JoinNode
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 AgentState,
_config: &'life2 GraphConfig,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 AgentState,
_config: &'life2 GraphConfig,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute this node
Auto Trait Implementations§
impl !RefUnwindSafe for JoinNode
impl !UnwindSafe for JoinNode
impl Freeze for JoinNode
impl Send for JoinNode
impl Sync for JoinNode
impl Unpin for JoinNode
impl UnsafeUnpin for JoinNode
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