Overview
dfx is a Linux-based dynamic dataflow executor.
It constructs, runs, and manages directed graphs of computational nodes that exchange messages through typed channels. Each node performs a unit of work, while channels define message flow and execution dependencies between nodes.
The primary responsibilities of dfx are:
- loading and validating dataflow graphs,
- executing nodes asynchronously and safely,
- coordinating message delivery between nodes,
- integrating external event sources (file descriptors, timers, processes),
- managing runtime concurrency and scheduling.
Graph model
A graph is composed of:
- Nodes: stateful computation units with input and output ports,
- Channels: directed connections between node ports,
- Messages: data objects flowing through channels.
Graphs are defined using .dfx configuration files and may be modified at runtime (nodes added/removed, channels rewired) without stopping execution.
Execution model
Execution is fully asynchronous and event-driven.
Key characteristics:
- Nodes are executed on a shared thread pool.
- Only one thread may execute inside a given node at any time.
- Message delivery may be performed inline (fast-path) or deferred, depending on runtime conditions and node policies.
- Deep or cyclic graphs are protected against stack overflow by enforcing bounded inline execution depth.
The runtime uses:
- a dedicated FD listener thread for I/O readiness detection,
- a task-based scheduler to dispatch work to worker threads,
- node-aware serialization to guarantee safe execution.
Runtime control
While running, dfx exposes a Unix domain socket control interface that allows:
- graph inspection,
- dynamic graph modification,
- runtime configuration updates,
- node lifecycle control.
This enables external tools or daemons to control a running instance of dfx without restarting it.
Scalability
dfx is designed to scale across:
- multiple CPU cores,
- varying workloads,
- graphs with heterogeneous node behavior.
Concurrency is controlled centrally by the runtime scheduler, which balances throughput, latency, and safety.
Platform constraints
- Target platform: Linux
- Execution relies on Linux primitives (epoll, eventfd, Unix domain sockets).
- No GUI or display system is required.
What dfx is (and is not)
dfx is:
- a runtime execution engine,
- a message-driven computation framework,
- a foundation for building higher-level tooling and orchestration.
dfx is not:
- a UI application,
- a static batch processor,
- a scripting language runtime.
Higher-level management, orchestration, or visualization is expected to be provided by companion binaries and tools.