yggdrasil v3.0.2 Yggdrasil.Broker

A server to manage the subscriptions inside Yggdrasil.

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

Functions

start_link(generator, monitors, options \\ [])

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.

stop(broker, reason \\ :normal)

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

subscribe(broker, channel)

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

subscribe(broker, channel, pid)

Asks the broker to subscribe the pid to a channel.

unsubscribe(broker, channel)

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

unsubscribe(broker, channel, pid)

Asks the broker to unsubscribe the pid to a channel.