|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Dynamic fan-out request (map-reduce pattern). More...
#include <types.h>
Public Attributes | |
| json | input |
| Channel writes for that invocation. | |
| std::string | target_node |
| Node to dispatch. | |
Dynamic fan-out request (map-reduce pattern).
A node can return Send objects to dispatch the same (or different) node multiple times with different inputs. Send targets are joined as one Asio parallel group; CPU work uses multiple threads only when the caller or engine supplies a multi-threaded executor.
Each multi-Send worker runs on an isolated GraphState copy: channel writes made inside a Send target are scoped to that worker and only merged back (via each channel's reducer) after all siblings finish. Concurrent workers therefore cannot corrupt each other's channel view.
This isolation does NOT extend to out-of-state side effects. If two Send workers call the same LLM provider instance, hit the same HTTP client, or write to the same file descriptor, they do so concurrently — whatever thread safety those external objects offer is what governs the outcome. Make sure any resource a Send target touches is either thread-safe or scoped per-invocation; a shared provider handle alone does not establish that a custom implementation is concurrency-safe.
Each Send execution is listed in RunResult::execution_trace as "<target_node>[send]", so a node that runs by Send and by an edge shows two kinds of entry. A step lists its ready nodes first, then its Sends in the order they were emitted (the ready nodes' order, then each node's own), not in the order they finished.