Class: MQ::Header
Constant Summary
Constants included from AMQP
AMQP::FIELDS, AMQP::HEADER, AMQP::PORT, AMQP::RESPONSES, AMQP::VERSION, AMQP::VERSION_MAJOR, AMQP::VERSION_MINOR
Instance Method Summary collapse
-
#ack ⇒ Object
Acknowledges the receipt of this message with the server.
-
#initialize(mq, header_obj) ⇒ Header
constructor
A new instance of Header.
- #inspect ⇒ Object
- #method_missing(meth, *args, &blk) ⇒ Object
-
#reject(opts = {}) ⇒ Object
Reject this message (XXX currently unimplemented in rabbitmq) * :requeue => true | false (default false).
Methods included from AMQP
client, client=, connect, fork, settings, start, stop, vstart
Constructor Details
#initialize(mq, header_obj) ⇒ Header
Returns a new instance of Header.
5 6 7 8 |
# File 'lib/mq/header.rb', line 5 def initialize(mq, header_obj) @mq = mq @header = header_obj end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
25 26 27 |
# File 'lib/mq/header.rb', line 25 def method_missing meth, *args, &blk @header.send meth, *args, &blk end |
Instance Method Details
#ack ⇒ Object
Acknowledges the receipt of this message with the server.
11 12 13 14 15 |
# File 'lib/mq/header.rb', line 11 def ack @mq.callback{ @mq.send Protocol::Basic::Ack.new(:delivery_tag => properties[:delivery_tag]) } end |
#inspect ⇒ Object
29 30 31 |
# File 'lib/mq/header.rb', line 29 def inspect @header.inspect end |
#reject(opts = {}) ⇒ Object
Reject this message (XXX currently unimplemented in rabbitmq)
-
:requeue => true | false (default false)
19 20 21 22 23 |
# File 'lib/mq/header.rb', line 19 def reject opts = {} @mq.callback{ @mq.send Protocol::Basic::Reject.new(opts.merge(:delivery_tag => properties[:delivery_tag])) } end |