yggdrasil v2.0.0 Yggdrasil.Broker

A server to manage the subscriptions inside Yggdrasil.

Summary

Functions

Sends a request to server to counts the number of subscribers for a channel

Sends a request to server to get the channels where the current process is subscribed

Sends a request to server to get the channels where the process pid is subscribed

Sends a request to server to get the subscribers of a channel

Starts the broker. Receives the generator and a :ets table monitors to store information of the subscribers and opts a list of GenServer options

Stops the broker server with a reason. By default reason is :normal

Sends a request to server to subscribe the current process to a channel

Sends a request to server to subscribe the process pid to a channel

Sends a request to server to unsubscribe the current process from a channel

Sends a request to server to unsubscribe the process pid from a channel

Functions

count_subscribers(server, channel)

Sends a request to server to counts the number of subscribers for a channel.

get_channels(server)

Sends a request to server to get the channels where the current process is subscribed.

get_channels(server, pid)

Sends a request to server to get the channels where the process pid is subscribed.

get_subscribers(server, channel)

Sends a request to server to get the subscribers of a channel.

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

Starts the broker. Receives the generator and a :ets table monitors to store information of the subscribers and opts a list of GenServer options.

stop(server, reason \\ :normal)

Stops the broker server with a reason. By default reason is :normal.

subscribe(server, channel)

Sends a request to server to subscribe the current process to a channel.

subscribe(server, channel, pid)

Sends a request to server to subscribe the process pid to a channel.

unsubscribe(server, channel)

Sends a request to server to unsubscribe the current process from a channel.

unsubscribe(server, channel, pid)

Sends a request to server to unsubscribe the process pid from a channel.