TaskBunny.PublisherWorker (CargueroTaskBunny v0.0.3) View Source

GenServer worker to publish a message on a queue

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Attempt to get a channel for the current connection and publish the message on the specified queue

Initializes the GenServer

Starts the publisher

Closes the AMQP channels opened to publish

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

close_channel(AMQP.Channel.t() | nil) ::
  false | :ok | {:error, {:error, :blocked | :closing}}
Link to this function

handle_call(msg, from, state)

View Source

Specs

handle_call(
  {:publish, atom(), String.t(), String.t(), String.t(), list()},
  any(),
  map()
) :: {:reply, :ok, map()}

Attempt to get a channel for the current connection and publish the message on the specified queue

Specs

init(any()) :: {:ok, map()}

Initializes the GenServer

Specs

start_link(list()) :: GenServer.on_start()

Starts the publisher

Specs

terminate(any(), map()) :: :ok

Closes the AMQP channels opened to publish