1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! `async-nodes` is a generic, type-safe execution engine implementing the Bulk
//! Synchronous Parallel (BSP) standard for **control-flow graphs with loops**, with the
//! classic dataflow-once pipelines expressed as a profile on the same core.
//!
//! # One core, two faces
//!
//! The engine core is control-flow with BSP superstep parallelism: nodes are
//! re-executable units over a consumer-owned state `S`, edges are *data* carrying
//! declarative [`Condition`]s, and activation is token-based (Kahn-style firing), which
//! makes loops first-class topology — a back-edge simply delivers another token.
//!
//! A **dataflow DAG is a control-flow graph in which each node fires exactly once, when
//! all its inputs are ready.** That profile (pins, links, `#[node]` macros, `BspSkip`
//! propagation, static inputs) keeps its guarantees — static analyzability, trivial
//! scheduling, no infinite loops by construction — without being a second engine.
//!
//! # The moving parts
//!
//! - [`BspGraph`] — the blueprint: nodes, [`graph::Edge`]s, static inputs, and the
//! consumer's named-condition / merger registries. Author graphs with the fluent
//! builder; exchange them as [`def::GraphDef`] JSON.
//! - [`BspEngine`] — the scheduler: frontier supersteps under `buffer_unordered`, bounded
//! by `max_concurrency`; circuit breakers (`max_steps`, per-edge `max_iterations`,
//! per-node `max_executions`, per-edge token caps); recovery policies; suspension.
//! - [`BspNode`] — the consumer's computation unit, generic over the consumer state `S`.
//! - [`NodeRegistry`] — node factories + named conditions + mergers, making graphs
//! instantiable from JSON.
//! - [`BspInterceptor`] — the live event stream (supersteps, edges taken, loop
//! iterations, retries, suspensions) a GUI subscribes to.
//!
//! # A loop, briefly
//!
//! ```text
//! entry ──▶ Generate ──[has_more]──▶ Tools ──[always]──▶ Generate (back-edge, max_iterations = 30)
//! │
//! └──────[done]──────▶ next-node…
//! ```
//!
//! Joins inside loops are almost always [`Activation::Any`] or merger-joins: an
//! `All`-join on a cycle starves (one incoming edge fires once ever, the other once per
//! iteration) — see [`engine`] for the diagram, and expect a validation warning.
pub use ;
pub use BspContext;
pub use ;
pub use ;
pub use BspError;
pub use ChannelInterceptor;
pub use ;
pub use ;
pub use Merger;
pub use ;
pub use ;
pub use NodeRegistry;
pub use ;
pub use ;
// Re-export proc-macros
pub use ;
// Hidden re-exports to provide macro hygiene in downstream projects
pub use async_trait;
pub use indexmap;
// Re-export typemap_rev to simplify implementation of TypeMapKey for users
pub use typemap_rev;
pub use tokio;