|
Dnzl is an Actor System for Nix based on Ned stream-cycles. Write behaviours as plain functions, automatic behaviour replacement, state keeping and error handling. Compose them into pipelines, fan-outs, and feedback loops using lazy Full documentation, patterns, and reference at https://dnzl.denful.dev |
|
Stateful stream processing. Each actor maintains state across messages via function closures. State threads through scanl — no mutable variables, no global state.
Behaviour switching. An actor can replace itself with a new behaviour after each message. State machines are just functions calling functions.
Either routing. Tag replies as right (success) or left (failure). outbox.right and outbox.left are sub-streams of bare values — no unwrapping needed.
Lazy pipelines. Wire one actor's outbox as another's inbox. Nix laziness resolves evaluation order — no explicit sequencing.
Capability refs. A cycle-c is a Nix value. Return it as a reply; the receiver gains the ability to invoke that actor. Holding the ref is the permission.
Fan-out and scatter-gather. Spawn N independent actors with builtins.map, collect results with merge. Order is deterministic.
Content-based routing. when-c filters a shared stream to per-actor slices. Multiple actors share one inbox without coupling.
