Jido.Signal.Bus.Stream (Jido v1.1.0-rc.2)

View Source

Provides 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

ack(state, subscription_id, signal)

Acknowledges a signal for a given subscription.

clear(state)

Clears all signals from the log.

dbug(_, _ \\ [])

(macro)

error(_, _ \\ [])

(macro)

filter(state, type_pattern, start_timestamp \\ nil, opts \\ [])

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.

publish(state, signals)

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.

truncate(state, max_size)

Truncates the signal log to the specified maximum size. Keeps the most recent signals and discards older ones.