#dataflow #graph #dataflow-graph

daedalus-core

Core types and shared utilities for the Daedalus dataflow stack

2 releases

Uses new Rust 2024

1.0.0 Jan 19, 2026
0.1.1 Jan 23, 2026
0.1.0 Jan 19, 2026

#715 in Concurrency


Used in 6 crates (4 directly)

MIT/Apache

84KB
2K SLoC

daedalus-core

Foundational types shared across the workspace: compute affinity, sync policy, IDs, metrics, errors, and channel utilities.

Highlights

  • Enums for compute affinity (CPU/GPU preferences), sync policies, and metrics.
  • Typed IDs for nodes/edges to keep registry/planner/runtime aligned.
  • Channel helpers for bounded/unbounded/broadcast/newest delivery semantics.
  • Error types shared between planner/runtime/engine.

Usage

  • Imported transitively through the facade crates; rarely used directly.
  • Channel implementations are used inside the runtime executors and host bridges.

lib.rs:

Base plumbing for the Daedalus pipeline stack.

This crate is intentionally small and feature-light: it owns IDs, errors, clocks/ticks, message envelopes, channel primitives, and (optionally) a tiny metrics facade. Higher layers (daedalus-data, daedalus-registry, planner/runtime crates) depend on these building blocks and must not inject new global state or cfg mazes here.

IDs serialize deterministically as "prefix:n" strings (e.g., "node:1", "edge:7") to keep planner/runtime diagnostics and golden outputs stable. Message payloads are generic; callers are expected to uphold any Send/Sync guarantees required by their runtime context.

Examples

Send/recv on a bounded channel:

use daedalus_core::channels::{bounded, ChannelRecv, ChannelSend, RecvOutcome};

let (tx, rx) = bounded(2);
assert_eq!(tx.send(1), daedalus_core::channels::Backpressure::Ok);
assert_eq!(tx.send(2), daedalus_core::channels::Backpressure::Ok);
assert_eq!(rx.try_recv(), RecvOutcome::Data(1));
assert_eq!(rx.try_recv(), RecvOutcome::Data(2));

Manual tick clock:

use daedalus_core::clock::TickClock;
let clock = TickClock::default();
let t1 = clock.tick();
let t2 = clock.advance(5);
assert!(t2.value() > t1.value());

Concurrency/typing notes: channel factories enforce Send on payloads; if your runtime requires Sync as well, enforce it at your boundary (e.g., ChannelSend<Arc<T>> with T: Send + Sync). IDs serialize as "prefix:n" strings for stable planner/runtime diagnostics and goldens.

Dependencies

~0.4–1.7MB
~32K SLoC