Exchange v0.2.4 Exchange.Adapters.TestEventBus View Source
Public API to use the adapter of Exchange.MessageBus
, the Test Event Bus.
This is used to test the messages sent by the Matching Engine, therefore, it doesn't send any messages it only stores them in memory.
The Agent
behaviour is used to encapsulate the messages that are meant to be sent in a real scenario.
Link to this section Summary
Functions
Checks if the key
is a valid event, if it is valid return :ok
otherwise returns :error
Stores the payload
in the adapter state
Returns a specification to start this module under a supervisor.
Checks if the key
is a valid event, if it is valid return :ok
otherwise returns :error
Link to this section Functions
Specs
add_listener(any()) :: :error | :ok
Checks if the key
is a valid event, if it is valid return :ok
otherwise returns :error
Parameters
- key: Event to register
Specs
cast_event( :order_cancelled | :order_expired | :order_queued | :price_broadcast | :trade_executed, any() ) :: nil | :ok
Stores the payload
in the adapter state
Parameters
- key: Payload's event type
- payload: Data to be sent to the processes
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
remove_listener(any()) :: :error | :ok
Checks if the key
is a valid event, if it is valid return :ok
otherwise returns :error
Parameters
- key: Event to unregister