class

AMQP::Client::Queue

Inherits Reference < Object

High-level representation of a Queue

Example:

client = AMQP::Client.new.connect
ch = client.channel
q = ch.queue("foobar")
q.bind("amq.fanout", "")
q.subscribe do |msg|
  puts msg.body_io
end

Instance methods

bind(exchange : String, routing_key : String, no_wait = false, args arguments : NamedTuple = NamedTuple.new)
Source
bind(exchange : String, routing_key : String, no_wait = false, args arguments = Arguments.new)

Bind the queue to an exchange

Source
consumer_count

Check number of consumers of the queue

Source
delete(if_unused = false, if_empty = false)

Delete the queue

See Channel#queue_delete

Source
get(no_ack = true)

Poll the queue for a message

See Channel#basic_get

Source
message_count

Check number of messages in the queue

Source
name

Name of the queue

Source
publish(io : IO, bytesize : Int, mandatory = false, immediate = false, props properties = Properties.new)

Publish a message directly to the queue

Source
publish(message, mandatory = false, immediate = false, props properties = Properties.new)

Publish a message directly to the queue

Source
publish(io : IO, bytesize : Int, mandatory = false, immediate = false, props properties = Properties.new, &blk : Bool -> Nil)

Publish a message directly to the queue, block is called when message is confirmed

Source
publish(message, mandatory = false, immediate = false, props properties = Properties.new, &blk : Bool -> Nil)

Publish a message directly to the queue, block is called when message is confirmed

Source
publish_confirm(io : IO, bytesize : Int, mandatory = false, immediate = false, props properties = Properties.new)

Publish and confirm a message directly to the queue

Source
publish_confirm(message, mandatory = false, immediate = false, props properties = Properties.new)

Publish and confirm a message directly to the queue

Source
purge

Purge the queue

See Channel#queue_purge

Source
subscribe(tag = "", no_ack = true, exclusive = false, block = false, args arguments : NamedTuple = NamedTuple.new, work_pool = 1, &blk : DeliverMessage -> Nil)
Source
subscribe(tag = "", no_ack = true, exclusive = false, block = false, args arguments = Arguments.new, work_pool = 1, &blk : DeliverMessage -> Nil)

Consume messages from the queue

See Channel#basic_consume

Source
unbind(exchange : String, routing_key : String, args arguments : NamedTuple = NamedTuple.new)
Source
unbind(exchange : String, routing_key : String, args arguments = Arguments.new)

Unbind the queue from an exchange

Source
unsubscribe(consumer_tag, no_wait = true)

Unsubscribe from the queue

See Channel#basic_cancel for more details

Source