greyhound v0.1.0 Greyhound
Link to this section Summary
Functions
Emits an event for processing
Subscribe a listener to a topic
Returns a list of processes subscribed to a topic
Unsubscribe a listener from a topic
Link to this section Functions
Link to this function
dispatch(server, topic, message)
Emits an event for processing.
Events are processed using middleware. See Greyhound.Middleware for more
details.
Example
iex> Greyhound.dispatch(MyApp.Bus, "a_topic", "a message")
:ok
Link to this function
subscribe(server, topic, pid)
Subscribe a listener to a topic.
Example
iex> subscribe(MyApp.Bus, "a_topic", self())
:ok
Link to this function
subscribers(server, topic)
Returns a list of processes subscribed to a topic.
Example
iex> subscribers(MyApp.Bus, "a_topic")
[#PID<0.173.0>, #PID<0.174.0>, #PID<0.175.0>]
Link to this function
unsubscribe(server, topic, pid)
Unsubscribe a listener from a topic.
Example
iex> unsubscribe(MyApp.Bus, "a_topic", self())
:ok