Jido.Signal.Bus.Stream (Jido Signal v1.0.0)
View SourceProvides streaming functionality for the signal bus.
This module contains functions for filtering, processing, and publishing signals through the bus streaming interface. It supports operations like filtering signals by type pattern and timestamp, as well as publishing signals to subscribers.
Summary
Functions
Acknowledges a signal for a given subscription.
Clears all signals from the log.
Filters signals from the bus state's log based on type pattern and timestamp. The type pattern is used for matching against the signal's type field.
Publishes signals to the bus, recording them and routing them to subscribers. Each signal is routed based on its own type field. Only accepts proper Jido.Signal structs to ensure system integrity. Signals are recorded and routed in the exact order they are received.
Truncates the signal log to the specified maximum size. Keeps the most recent signals and discards older ones.
Functions
@spec ack(Jido.Signal.Bus.State.t(), String.t(), Jido.Signal.t()) :: {:ok, Jido.Signal.Bus.State.t()} | {:error, atom()}
Acknowledges a signal for a given subscription.
@spec clear(Jido.Signal.Bus.State.t()) :: {:ok, Jido.Signal.Bus.State.t()}
Clears all signals from the log.
@spec filter(Jido.Signal.Bus.State.t(), String.t(), integer() | nil, keyword()) :: {:ok, [Jido.Signal.Bus.RecordedSignal.t()]} | {:error, atom()}
Filters signals from the bus state's log based on type pattern and timestamp. The type pattern is used for matching against the signal's type field.
@spec publish(Jido.Signal.Bus.State.t(), [Jido.Signal.t()]) :: {:ok, Jido.Signal.Bus.State.t()} | {:error, atom()}
Publishes signals to the bus, recording them and routing them to subscribers. Each signal is routed based on its own type field. Only accepts proper Jido.Signal structs to ensure system integrity. Signals are recorded and routed in the exact order they are received.
@spec truncate(Jido.Signal.Bus.State.t(), non_neg_integer()) :: {:ok, Jido.Signal.Bus.State.t()}
Truncates the signal log to the specified maximum size. Keeps the most recent signals and discards older ones.