|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
NodeExecutor — owns per-super-step node invocation. More...
#include <neograph/api.h>#include <neograph/graph/types.h>#include <neograph/graph/node.h>#include <neograph/graph/compiler.h>#include <neograph/graph/coordinator.h>#include <neograph/graph/node_cache.h>#include <neograph/graph/scheduler.h>#include <asio/thread_pool.hpp>#include <atomic>#include <chrono>#include <exception>#include <functional>#include <map>#include <memory>#include <optional>#include <string>#include <string_view>#include <unordered_map>#include <vector>Go to the source code of this file.
Classes | |
| class | neograph::graph::NodeExecutor |
| Stateless-per-call node invocation dispatcher. More... | |
Functions | |
| NEOGRAPH_API bool | neograph::graph::wait_for_node_attempts (std::chrono::milliseconds timeout=std::chrono::milliseconds::max()) |
| Wait until no node attempt dispatched off its run's orchestrator is running anywhere in this process (#364, #367, #368). | |
NodeExecutor — owns per-super-step node invocation.
Extracted from GraphEngine::execute_graph so the three invocation paths that used to be open-coded inside the super-step loop sit behind named methods with their own invariants:
asio::experimental::make_parallel_group. Records per-worker pending writes, captures the first worker exception, and rethrows after every branch has finished. After the barrier, applies each result's writes + Command.updates to the shared state.The executor owns execute_node_with_retry_async — the innermost retry loop with exponential backoff + NodeInterrupt pass-through. Retry policies are resolved per node via a lookup callback supplied by GraphEngine at construction; the executor itself is agnostic about where the policy came from.
Thread safety: all fan-out runs on whichever executor co_await asio::this_coro::executor yields — typically GraphEngine's owned thread_pool. Multiple concurrent executions against the same NodeExecutor instance are safe iff the underlying GraphNode subclasses are safe.
3.0 removed the sync run_one/run_parallel/run_sends twins and the former process-wide executor. Sync callers drive the Asio coroutine peers inline by default or through GraphEngine's opt-in thread_pool (see graph_engine.cpp).
Definition in file executor.h.
| NEOGRAPH_API bool neograph::graph::wait_for_node_attempts | ( | std::chrono::milliseconds | timeout = std::chrono::milliseconds::max() | ) |
Wait until no node attempt dispatched off its run's orchestrator is running anywhere in this process (#364, #367, #368).
An attempt that ignored its cancellation past its stop deadline outlives the run that timed it out (the run failed with NG.EffectUncertain). A host that is about to exit, or to tear down what such a node uses, can wait for it here. The Python binding does so at interpreter exit.
| timeout | How long to wait; milliseconds::max() waits without a limit. |
References neograph::graph::wait_for_node_attempts().
Referenced by neograph::graph::wait_for_node_attempts().