Added callbacks for node errors and fifo overflow
📚 Docs / deploy (push) Failing after 7s
🧪 Test / test (push) Has been cancelled

Add new doc system which should/might deploy to pages.
This commit is contained in:
2026-06-19 22:26:39 +02:00
parent 79916f1da1
commit 6f384dc4b5
30 changed files with 1192 additions and 82 deletions
+4 -4
View File
@@ -33,7 +33,7 @@ static std::string generate() {
return pairs[gen_index++ % 5];
}
// [snippet: multi_output_fn]
// --8<-- [start:multi_output_fn]
// Multi-output: returns (key, value) as a tuple — KPN++ routes each element
// to its own output port automatically.
static std::tuple<std::string, std::string> parse(std::string kv) {
@@ -41,7 +41,7 @@ static std::tuple<std::string, std::string> parse(std::string kv) {
if (sep == std::string::npos) return {kv, ""};
return {kv.substr(0, sep), kv.substr(sep + 1)};
}
// [/snippet: multi_output_fn]
// --8<-- [end:multi_output_fn]
static void print_key(std::string key) {
std::cout << "KEY → " << key << '\n';
@@ -56,7 +56,7 @@ static void print_value(std::string value) {
int main() {
using namespace kpn;
// [snippet: fanout_network]
// --8<-- [start:fanout_network]
auto gen = make_node<generate>(out<"kv">{}, 4);
auto par = make_node<parse> (in<"kv">{}, out<"key", "value">{}, 4);
auto keys = make_node<print_key> (in<"key">{}, 4);
@@ -75,5 +75,5 @@ int main() {
net.start();
std::this_thread::sleep_for(std::chrono::milliseconds(600));
net.stop();
// [/snippet: fanout_network]
// --8<-- [end:fanout_network]
}