Examples.EEVentBroker.WithSub (Anoma v0.31.0)

I contain examples of how the with_subscription block works.

Summary

Functions

I check that, when a process is subscribed to a given filter, that filter still exists after a with_subscription block that uses the same filter.

I nest two with_subscription blocks and assert that the middle one is subscribed to the outer topics as well.

I run a piece of code with a subscription. I assert that the messages sent within this block are sent to me.

I run a piece of code with a subscription to multiple filters. I assert that the messages sent within this block are sent to me.

Functions

Link to this function

with_existing_subscription(filter \\ %EFilter.AcceptAll{})

@spec with_existing_subscription(struct()) :: struct()

I check that, when a process is subscribed to a given filter, that filter still exists after a with_subscription block that uses the same filter.

Link to this function

with_nested_subscription(list \\ [%{__struct__: Examples.EEVentBroker.EFilter.AcceptAll}, %{__struct__: Examples.EEVentBroker.EFilter.Error}])

@spec with_nested_subscription([struct()]) :: [struct()]

I nest two with_subscription blocks and assert that the middle one is subscribed to the outer topics as well.

Link to this function

with_subscription(filter \\ %EFilter.AcceptAll{})

@spec with_subscription(struct()) :: struct()

I run a piece of code with a subscription. I assert that the messages sent within this block are sent to me.

Link to this function

with_subscriptions(filters \\ [%{__struct__: Examples.EEVentBroker.EFilter.AcceptAll}, %{__struct__: Examples.EEVentBroker.EFilter.Error}])

@spec with_subscriptions([struct()]) :: [struct()]

I run a piece of code with a subscription to multiple filters. I assert that the messages sent within this block are sent to me.