Exchange v0.2.3 Exchange.Adapters.RabbitBus View Source

Public API to use the adapter of Exchange.MessageBus, the RabbitBus. To use this adapter is necessary to add the AMQP to the dependencies.

Link to this section Summary

Functions

It calls the consumer server and it adds the process calling to the subscribers of the event.

It calls the producer server and sends it the event and the payload to be casted.

It calls the consumer server and it removes the process calling from the subscribers of the event.

Creates the necessary exchange and queue to this adapter and binds them.

Link to this section Functions

Specs

add_listener(key :: String.t()) :: :error | :ok

It calls the consumer server and it adds the process calling to the subscribers of the event.

Parameters

  • key: Event to register the process
Link to this function

cast_event(atom, payload)

View Source

Specs

cast_event(
  :order_cancelled
  | :order_expired
  | :order_queued
  | :price_broadcast
  | :trade_executed,
  any()
) :: nil | :ok

It calls the producer server and sends it the event and the payload to be casted.

Parameters

  • key: Event to register the process

Specs

remove_listener(key :: String.t()) :: :error | :ok

It calls the consumer server and it removes the process calling from the subscribers of the event.

Parameters

  • key: Event to register the process

Specs

setup_resources() :: :ok

Creates the necessary exchange and queue to this adapter and binds them.

Link to this function

validate_config(config \\ [])

View Source