phasedb v0.0.2 PhaseDB.Subscription

Simple pub/sub process subscription using gproc.

Summary

Functions

List all the processes subscribed to this identifier

Broadcast an event to all processes subscribed to the identifier

Subscribe the current process to a given identifier

Tell me if this process is subscribed to this identifier

Unsubscribe the current process from the given identifier

Unsubscribe all processes from the given identifier

Types

event :: any
id :: any

Functions

all_subscribers(id)

Specs

all_subscribers(id) :: [pid]

List all the processes subscribed to this identifier.

broadcast(id, event)

Specs

broadcast(id, event) :: :ok

Broadcast an event to all processes subscribed to the identifier.

subscribe(id)

Specs

subscribe(id) :: :ok

Subscribe the current process to a given identifier.

subscribed?(id, pid)

Specs

subscribed?(id, pid) :: boolean

Tell me if this process is subscribed to this identifier.

unsubscribe(id)

Specs

unsubscribe(id) :: :ok

Unsubscribe the current process from the given identifier.

unsubscribe_all(id)

Specs

unsubscribe_all(id) :: :ok

Unsubscribe all processes from the given identifier.