Principle:1kbgz Tributary Reactive Streaming
| Knowledge Sources | |
|---|---|
| Domains | Streaming, Reactive_Programming |
| Last Updated | 2026-10-14 00:00 GMT |
Overview
A reactive data flow paradigm where data propagates forward through a directed acyclic graph of nodes, each producing values asynchronously via generators and consuming upstream values via input queues.
Description
Reactive streaming models computation as a forward-propagating graph where each node is an async entity that consumes values from upstream input queues, applies a transformation, and pushes results downstream. Unlike pull-based (lazy) evaluation, streaming nodes are data-driven: they fire when inputs arrive rather than when their values are requested.
This paradigm addresses the limitation of batch processing for real-time data: instead of collecting all data before processing, each value flows through the graph as it arrives. The async generator protocol (PEP 525) enables Python-native cooperative multitasking, allowing multiple nodes to execute concurrently within a single asyncio event loop.
Key characteristics:
- Forward propagation: Data flows from sources through transforms to sinks.
- Async execution: Nodes run as coroutines, scheduled by the event loop.
- Backpressure: Downstream congestion can be signaled upstream.
- Tick policies: Mismatched production/consumption rates are handled via drop, replace, or repeat semantics.
Usage
Use this principle when designing systems for real-time data processing, event-driven pipelines, or any scenario where data arrives incrementally and must be processed immediately. It is the foundation for ETL pipelines, streaming analytics, and financial market data processing.
Theoretical Basis
The reactive streaming model is based on the dataflow programming paradigm. Each node is a process that:
- Reads from input queues (one per upstream dependency)
- Applies its wrapped callable
- Pushes the result to all downstream node input queues
# Abstract dataflow model (NOT real implementation)
async def node_execute(node):
for input_queue in node.input_queues:
value = await input_queue.get()
result = node.func(*node.active_inputs)
for downstream, port in node.downstream_connections:
await downstream.push(result, port)
The graph execution is level-by-level: nodes are grouped into topological layers, and within each layer all nodes execute concurrently via asyncio.gather. Layers execute sequentially to respect data dependencies.
Related Pages
Implemented By
- Implementation:1kbgz_Tributary_Streaming_Input_Sources
- Implementation:1kbgz_Tributary_Streaming_Operators
- Implementation:1kbgz_Tributary_Streaming_Node