grizzly v0.4.2 Grizzly.Notifications View Source

A pubsub module for sending and receiving notifications to and from Grizzly.

Link to this section Summary

Types

The topics that are allowed for Grizzly notifications

Functions

Broadcast a topic to the processes that are subscribed

Broadcast a topic and some data with the topic. This will send the subscriber a tuple in the shape of {topic, data}

Subscribe to a topic to receive messages

Subscribe to a list of topics

Unsubscribe from a topic

Link to this section Types

Link to this type

topic() View Source
topic() ::
  :controller_connected
  | :connection_established
  | :unsolicited_message
  | :node_added
  | :node_removed
  | :node_updated

The topics that are allowed for Grizzly notifications

Link to this section Functions

Link to this function

broadcast(topic) View Source
broadcast(topic()) :: :ok

Broadcast a topic to the processes that are subscribed

Link to this function

broadcast(topic, data) View Source
broadcast(topic(), data :: any()) :: :ok

Broadcast a topic and some data with the topic. This will send the subscriber a tuple in the shape of {topic, data}

Link to this function

subscribe(topic) View Source
subscribe(topic()) :: :ok | {:error, :already_subscribed}

Subscribe to a topic to receive messages

Link to this function

subscribe_all(topics) View Source
subscribe_all([topic()]) :: :ok

Subscribe to a list of topics

Link to this function

unsubscribe(topic) View Source
unsubscribe(topic()) :: :ok

Unsubscribe from a topic