Redix.PubSub.unsubscribe
You're seeing just the function
unsubscribe
, go back to Redix.PubSub module for more information.
Specs
unsubscribe(connection(), String.t() | [String.t()], subscriber()) :: :ok
Unsubscribes subscriber
from the given channel or list of channels.
This function basically "undoes" what subscribe/3
does: it unsubscribes
subscriber
from the given channel or list of channels.
Upon successful unsubscription from each of the channels
, a message will be
sent to subscriber
with the following form:
{:redix_pubsub, pid, ^subscription_ref, :unsubscribed, %{channel: channel}}
See the documentation for Redix.PubSub
for more information about the format
of messages.
Examples
iex> Redix.unsubscribe(conn, ["foo", "bar"], self())
:ok
iex> flush()
{:redix_pubsub, ^conn, ^subscription_ref, :unsubscribed, %{channel: "foo"}}
{:redix_pubsub, ^conn, ^subscription_ref, :unsubscribed, %{channel: "bar"}}
:ok