greyhound v0.1.0 Greyhound.TestBus
Link to this section Summary
Functions
Returns a list of middleware modules that implement the
Greyhound.Middleware callbacks
Emits an event for processing
Subscribes the current process to a topic
Returns a list of processes subscribed to a topic
Unsubscribes the current process from a topic
Link to this section Functions
Returns a list of middleware modules that implement the
Greyhound.Middleware callbacks.
Override this function if a different set of middleware is required.
Link to this function
dispatch(topic, message)
Emits an event for processing.
Events are processed using middleware. See Greyhound.Middleware for more
details.
Example
iex> Elixir.Greyhound.TestBus.dispatch("a_topic", "a message")
:ok
Subscribes the current process to a topic.
Example
iex> Elixir.Greyhound.TestBus.subscribe("a_topic")
:ok
Returns a list of processes subscribed to a topic.
Example
iex> Elixir.Greyhound.TestBus.subscribers("a topic")
[#PID<0.173.0>, #PID<0.174.0>, #PID<0.175.0>]