TaskBunny.Queue (CargueroTaskBunny v0.0.3) View Source

Convenience functions for accessing TaskBunny queues.

It's a semi private module normally wrapped by other modules.

Sub Queues

When TaskBunny creates(declares) a queue on RabbitMQ, it also creates the following sub queues.

  • [queue-name].scheduled: holds jobs to be executed in the future
  • [queue-name].retry: holds jobs to be retried
  • [queue-name].rejected: holds jobs that were rejected (failed more than max retry times or wrong message format)

Link to this section Summary

Functions

Declares a queue with sub queues.

Deletes the queue and its subqueues.

Returns a list that contains the queue and its subqueue.

Returns a name of rejected queue.

Returns a name of retry queue.

Returns a name of scheduled queue.

Returns the message count and consumer count for the given queue.

Returns all subqueues for the work queue.

Link to this section Functions

Link to this function

declare_with_subqueues(host, work_queue)

View Source

Specs

declare_with_subqueues(%AMQP.Connection{pid: term()} | atom(), String.t()) ::
  {map(), map(), map(), map()}

Declares a queue with sub queues.

Queue.declare_with_subqueues(:default, "normal_jobs")

For this call, the function creates(declares) three queues:

  • normal_jobs: a queue that holds jobs to process
  • normal_jobs.scheduled: a queue that holds jobs to process in the future
  • normal_jobs.retry: a queue that holds jobs failed and waiting to retry
  • normal_jobs.rejected: a queue that holds jobs failed and won't be retried
Link to this function

delete_with_subqueues(host, work_queue)

View Source

Specs

delete_with_subqueues(%AMQP.Connection{pid: term()} | atom(), String.t()) :: :ok

Deletes the queue and its subqueues.

Link to this function

queue_with_subqueues(work_queue)

View Source

Specs

queue_with_subqueues(String.t()) :: [String.t()]

Returns a list that contains the queue and its subqueue.

Link to this function

rejected_queue(work_queue)

View Source

Specs

rejected_queue(String.t()) :: String.t()

Returns a name of rejected queue.

Specs

retry_queue(String.t()) :: String.t()

Returns a name of retry queue.

Link to this function

scheduled_queue(work_queue)

View Source

Specs

scheduled_queue(String.t()) :: String.t()

Returns a name of scheduled queue.

Link to this function

state(host_or_conn \\ :default, queue)

View Source

Specs

state(%AMQP.Connection{pid: term()} | atom(), String.t()) :: map()

Returns the message count and consumer count for the given queue.

Specs

subqueues(String.t()) :: [String.t()]

Returns all subqueues for the work queue.