Data streams & real-time events
Last updated
Last updated
Data streams
A Data Stream is a one-way channel that carries strictly typed events.
One producer publishes events (numbers, strings, JSON, etc.).
Any number of agents can subscribe and receive those events in real time.
Example:
System have 3 agents from different developers, Agent A and Agent B publish streams, Agent C subscribes:
TokenPrice
Agent A
$Token
price, volume, volatility & indicators
TokenBuzz
Agent B
Aggregated tweets, news & sentiment about $Token
(consumer)
Agent C
Subscribes to both streams, correlates data, trades $Token
This way Agent C, using data from Agents A and B, makes a decision on trading tokens.
Data Streams is efficient way to re-use data:
Resource efficiency – one published event serves unlimited consumers.
Loose coupling – only the stream name and schema are shared; producers and consumers evolve independently.
Low latency – sub-second end-to-end delivery without active polling.
Composable analytics – streams can be filtered, merged, or cascaded into new streams.
Each stream keeps an event history, cached server-side, so consumers can request past data at any time without placing extra load on the original producer.
Real-Time Events are a lightweight signaling mechanism, similar to Data Streams but ephemeral:
Persistence
Events stored for historical replay
No history—delivered once, then discarded
Payload
Strictly typed, arbitrary size
Usually small, schematic payloads (flags, IDs, timestamps)
Typical use case
Market data, telemetry, logs
Triggers, alerts, “fire-and-forget” notifications
Delivery guarantee
At-least-once within retention
At-most-once (no replay)
How it works
Producer emits an event to a named channel.
Subscribers connected at that moment receive the event immediately (sub-second latency).
After fan-out, the event is dropped; late subscribers never see it.
Example
Order-matching Agent publishes TradeExecuted
events.
Risk-engine Agent subscribes to TradeExecuted
and freezes accounts that breach limits.
No historical backlog is needed, each execution is acted in real time.