Yggdrasil v5.0.0 Yggdrasil.Subscriber.Manager View Source
Manages subscription to a channel.
Link to this section Summary
Functions
Adds a pid
to the channel
.
Returns a specification to start this module under a supervisor.
Reports the connection of the adapter.
Reports the disconnection of the adapter.
Removes a pid
from the channel
.
Starts a manager with a channel
.
Stops a manager
with an optional reason
.
Whether the pid
is subscribed or not to the channel
.
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Yggdrasil.Subscriber.Manager{
cache: reference(),
channel: Yggdrasil.Channel.t(),
status: atom()
}
t() :: %Yggdrasil.Subscriber.Manager{ cache: reference(), channel: Yggdrasil.Channel.t(), status: atom() }
Link to this section Functions
Link to this function
add(channel, pid)
View Source
add(channel, pid)
View Source
add(Yggdrasil.Channel.t(), pid()) :: :ok | {:error, term()}
add(Yggdrasil.Channel.t(), pid()) :: :ok | {:error, term()}
Adds a pid
to the channel
.
Link to this function
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
Link to this function
connected(channel) View Source
Reports the connection of the adapter.
Link to this function
disconnected(channel) View Source
Reports the disconnection of the adapter.
Link to this function
remove(channel, pid)
View Source
remove(channel, pid)
View Source
remove(Yggdrasil.Channel.t(), pid()) :: :ok | {:error, term()}
remove(Yggdrasil.Channel.t(), pid()) :: :ok | {:error, term()}
Removes a pid
from the channel
.
Link to this function
start_link(channel, options \\ [])
View Source
start_link(channel, options \\ [])
View Source
start_link(channel :: Yggdrasil.Channel.t(), options :: GenServer.options()) ::
GenServer.on_start()
start_link(channel :: Yggdrasil.Channel.t(), options :: GenServer.options()) :: GenServer.on_start()
Starts a manager with a channel
.
Link to this function
stop(manager, reason \\ :normal)
View Source
stop(manager, reason \\ :normal)
View Source
stop(GenServer.name(), term()) :: :ok
stop(GenServer.name(), term()) :: :ok
Stops a manager
with an optional reason
.
Link to this function
subscribed?(channel, pid \\ nil)
View Source
subscribed?(channel, pid \\ nil)
View Source
subscribed?(Yggdrasil.Channel.t(), pid()) :: boolean()
subscribed?(Yggdrasil.Channel.t(), pid()) :: boolean()
Whether the pid
is subscribed or not to the channel
.