1.1 KiB
1.1 KiB
KPN++
A C++20 Kahn Process Network library. Each node wraps a plain function and runs concurrently, communicating with downstream nodes via bounded FIFO channels. Includes Python bindings via nanobind.
Why KPN++?
- Zero boilerplate — wrap any callable as a node; types flow automatically from the function signature
- Bounded channels — backpressure is structural, not bolted on
- Observable — per-node and network-level callbacks for overflow and stop events; diagnostics snapshots; optional web UI
- Composable —
Networkfor runtime wiring,StaticNetworkfor compile-time topology with zero overhead
Quick example
#include <kpn/kpn.hpp>
using namespace kpn;
--8<-- "examples/01_hello_pipeline/main.cpp:basic_node_fns"
int main() {
--8<-- "examples/01_hello_pipeline/main.cpp:network_build"
}
Install & build
cmake -B build
cmake --build build --parallel
ctest --test-dir build # unit tests + example smoke tests
See Getting Started for full build options.