Skip to main content

scripted_update_node

Function scripted_update_node 

Source
pub fn scripted_update_node<State, Update>(
    updates: impl IntoIterator<Item = Update>,
) -> impl Fn(State, NodeContext) -> NodeFuture<Update> + Send + Sync + 'static
where State: Send + 'static, Update: Clone + Send + Sync + 'static,
Expand description

A node that emits a fixed queue of updates, one per activation.

The first activation returns the first update, the second the second, and so on; once the queue is drained every later activation re-emits the last update (so the node stays well-defined inside a loop). An empty queue makes every activation fail with TinyAgentsError::Graph.