Jido.Bus (Jido v1.1.0-rc)
View SourceUse the signal store configured for a Commanded application.
Telemetry Signals
Adds telemetry signals for the following functions. Signals are emitted in the form
[:jido, :bus, signal]
with their spannable postfixes (start
, stop
, exception
)
- ack/3
- adapter/2
- publish/4
- delete_snapshot/2
- unsubscribe/3
- read_snapshot/2
- record_snapshot/2
- replay/2
- replay/3
- replay/4
- subscribe/2
- subscribe_persistent/5
- subscribe_persistent/6
- unsubscribe/2
Summary
Functions
Acknowledge receipt and successful processing of a signal.
Start a bus as part of a supervision tree.
Delete a previously recorded snapshot for a given source
Append one or more signals to a stream atomically.
Read a snapshot, if available, for a given source.
Record a snapshot of the data and metadata for a given source
Streams signals from the given stream, in the order in which they were originally written.
Start a bus process.
Create a transient subscription to a single signal stream.
Create a persistent subscription to an signal stream.
Unsubscribe an existing subscriber from signal notifications.
Delete an existing subscription.
Returns a via tuple for addressing the bus process.
Gets the PID of a running bus by name.
Types
Functions
Acknowledge receipt and successful processing of a signal.
Start a bus as part of a supervision tree.
Options
:name
- Required. The name to register the bus process under:adapter
- The adapter type. Either:pubsub
,:in_memory
, or a custom module- Other options are passed to the chosen adapter
Examples
children = [
{Jido.Bus, name: :jido_agent_123, adapter: :pubsub, pubsub_name: MyApp.PubSub}
]
Delete a previously recorded snapshot for a given source
Append one or more signals to a stream atomically.
Read a snapshot, if available, for a given source.
Record a snapshot of the data and metadata for a given source
Streams signals from the given stream, in the order in which they were originally written.
Start a bus process.
See child_spec/1
for options.
Create a transient subscription to a single signal stream.
Create a persistent subscription to an signal stream.
Unsubscribe an existing subscriber from signal notifications.
Delete an existing subscription.
Returns a via tuple for addressing the bus process.
Options
:registry
- The registry to use (defaults to Jido.BusRegistry)
Examples
iex> Jido.Bus.via_tuple(:my_bus)
{:via, Registry, {Jido.BusRegistry, :my_bus}}
iex> Jido.Bus.via_tuple(:my_bus, registry: MyApp.Registry)
{:via, Registry, {MyApp.Registry, :my_bus}}
Gets the PID of a running bus by name.
Returns {:ok, pid}
if found, {:error, :not_found}
otherwise.