yggdrasil v3.2.2 Yggdrasil.Broker View Source

A server to manage the subscriptions inside Yggdrasil.

Link to this section Summary

Functions

Starts the Broker. Receives the generator PID or name and a ETS table monitors to store the information of the subscribers. Optionally receives a list of GenServer options

Stops the broker with a PID or name and an optional reason. By default is :normal

Asks the broker to subscribe the calling process to a channel

Asks the broker to subscribe the pid to a channel

Asks the broker to unsubscribe the calling process to a channel

Asks the broker to unsubscribe the pid to a channel

Link to this section Functions

Link to this function start_link(generator, monitors, options \\ []) View Source

Starts the Broker. Receives the generator PID or name and a ETS table monitors to store the information of the subscribers. Optionally receives a list of GenServer options.

Link to this function stop(broker, reason \\ :normal) View Source

Stops the broker with a PID or name and an optional reason. By default is :normal.

Link to this function subscribe(broker, channel) View Source

Asks the broker to subscribe the calling process to a channel.

Link to this function subscribe(broker, channel, pid) View Source

Asks the broker to subscribe the pid to a channel.

Link to this function unsubscribe(broker, channel) View Source

Asks the broker to unsubscribe the calling process to a channel.

Link to this function unsubscribe(broker, channel, pid) View Source

Asks the broker to unsubscribe the pid to a channel.