Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Move queue utilities to a dedicated module (#124)
Browse files Browse the repository at this point in the history
This functionality might also have value for consumers and other use cases, so let's not lock it for publishers only.
  • Loading branch information
mkorszun authored Oct 31, 2019
1 parent 86c1ecc commit 89febcf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/publisher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule GenRMQ.Publisher do

require Logger

alias AMQP.Queue
alias GenRMQ.Queue

# list of fields permitted in message metadata at top level
@metadata_fields ~w(
Expand Down
11 changes: 11 additions & 0 deletions lib/queue.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule GenRMQ.Queue do
@moduledoc """
This module defines utility functions for queues
"""

defdelegate consumer_count(channel, queue), to: AMQP.Queue
defdelegate empty?(channel, queue), to: AMQP.Queue
defdelegate message_count(channel, queue), to: AMQP.Queue
defdelegate purge(channel, queue), to: AMQP.Queue
defdelegate status(channel, queue), to: AMQP.Queue
end

0 comments on commit 89febcf

Please sign in to comment.