KPN/docs/index.md
Duncan Tourolle 6f384dc4b5
Some checks failed
📚 Docs / deploy (push) Failing after 7s
🧪 Test / test (push) Has been cancelled
Added callbacks for node errors and fifo overflow
Add new doc system which should/might deploy to pages.
2026-06-19 22:26:39 +02:00

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
  • ComposableNetwork for runtime wiring, StaticNetwork for 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.