View Source Yggdrasil.Subscriber.Manager (Yggdrasil v6.0.3)

Manages subscription to a channel.

Link to this section Summary

Types

Subscription status.

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

@type status() :: :connected | :disconnected

Subscription status.

Link to this section Functions

@spec add(Yggdrasil.Channel.t(), pid()) :: :ok | {:error, binary()}

Adds a pid to the channel.

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec connected(Yggdrasil.Channel.t()) :: :ok | {:error, binary()}

Reports the connection of the adapter.

@spec disconnected(Yggdrasil.Channel.t()) :: :ok | {:error, binary()}

Reports the disconnection of the adapter.

@spec remove(Yggdrasil.Channel.t(), pid()) :: :ok | {:error, binary()}

Removes a pid from the channel.

Link to this function

start_link(channel, pid, options \\ [])

View Source

Starts a manager with a channel.

Link to this function

stop(manager, reason \\ :normal)

View Source
@spec stop(GenServer.name(), term()) :: :ok

Stops a manager with an optional reason.

Link to this function

subscribed?(channel, pid \\ nil)

View Source
@spec subscribed?(Yggdrasil.Channel.t(), nil | pid()) :: boolean()

Whether the pid is subscribed or not to the channel.