Jido.Signal.Bus.Subscriber (Jido Signal v1.0.0)
View SourceDefines the subscriber model and subscription management for the signal bus.
This module contains the subscriber type definition and functions for creating, managing, and dispatching signals to subscribers. It supports both regular and persistent subscriptions, handling subscription lifetime and signal delivery.
Summary
Functions
Unsubscribes from the bus by removing the subscription and cleaning up resources.
Types
Functions
@spec subscribe(Jido.Signal.Bus.State.t(), String.t(), String.t(), keyword()) :: {:ok, Jido.Signal.Bus.State.t()} | {:error, Jido.Signal.Error.t()}
@spec unsubscribe(Jido.Signal.Bus.State.t(), String.t(), keyword()) :: {:ok, Jido.Signal.Bus.State.t()} | {:error, Jido.Signal.Error.t()}
Unsubscribes from the bus by removing the subscription and cleaning up resources.
For persistent subscriptions, this also terminates the associated process.
Parameters
state
: The current bus statesubscription_id
: The unique identifier of the subscription to removeopts
: Additional options (currently unused)
Returns
{:ok, new_state}
if successful{:error, Error.t()}
if the subscription doesn't exist or removal fails