conejo v0.5.0 Conejo.Publisher View Source
Conejo.Publisher
is the behaviour which will help you to implement your own RabbitMQ Publisher.
Definition
defmodule MyApplication.MyPublisher do
use Conejo.Publisher
end
Start Up
{:ok, publisher} = MyApplication.MyPublisher.start_link([], [name: :publisher])
Synchronous Publishing
MyApplication.MyPublisher.sync_publish(:publisher, "my_exchange", "example", "Hola")
Asynchronous Publishing
MyApplication.MyPublisher.async_publish(:publisher, "my_exchange", "example", "Adios")