Examples.EEventBroker.Subscribe
(event_broker v1.1.1)
Copy Markdown
I define examples on how to susbcribe to topics in the event broker.
Summary
Functions
I subscribe using the Trivial filter and assert that I receive any events
sent on the message broker.
I subscribe to multiple filters and assert that I receive the events that are allowed by those filters.
I unsubscribe a process from a filter and verify that it is unsubscribed.
I subscribe a process to events, and check whether the registry cleans up its subscriptions when it goes offline.
I assert that the current process is subscribed to the given filter.
Callback implementation for ExExample.Behaviour.copy/1.
Given a list of filters, I make sure that the current process is not subscribed to them.
Callback implementation for ExExample.Behaviour.rerun?/1.
Functions
I subscribe using the Trivial filter and assert that I receive any events
sent on the message broker.
__ex_example__subscribe_to_multiple_filters__(filters \\ [%{__struct__: Examples.EEventBroker.EFilter.AcceptAll}, %{__struct__: Examples.EEventBroker.EFilter.Error}])
I subscribe to multiple filters and assert that I receive the events that are allowed by those filters.
I unsubscribe a process from a filter and verify that it is unsubscribed.
I subscribe a process to events, and check whether the registry cleans up its subscriptions when it goes offline.
I assert that the current process is subscribed to the given filter.
Callback implementation for ExExample.Behaviour.copy/1.
@spec refute_subscription([struct()] | struct()) :: [struct()] | struct()
@spec refute_subscription(struct()) :: struct()
Given a list of filters, I make sure that the current process is not subscribed to them.
Callback implementation for ExExample.Behaviour.rerun?/1.
subscribe_to_multiple_filters(filters \\ [%{__struct__: Examples.EEventBroker.EFilter.AcceptAll}, %{__struct__: Examples.EEventBroker.EFilter.Error}])
@spec unsubscribe_on_down() :: any()