bunny 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ module Bunny
20
20
  class ConnectionError < StandardError; end
21
21
  class MessageError < StandardError; end
22
22
 
23
- VERSION = '0.4.1'
23
+ VERSION = '0.4.2'
24
24
 
25
25
  # Returns the Bunny version number
26
26
 
@@ -265,6 +265,29 @@ _Bunny_::_ProtocolError_ is raised. If successful, _Client_._status_ is set to <
265
265
  end
266
266
 
267
267
  alias start start_session
268
+
269
+ =begin rdoc
270
+
271
+ === DESCRIPTION:
272
+
273
+ Asks the broker to redeliver all unacknowledged messages on a specifieid channel. Zero or
274
+ more messages may be redelivered.
275
+
276
+ ==== Options:
277
+
278
+ * <tt>:requeue => true or false (_default_)</tt> - If set to _false_, the message will be
279
+ redelivered to the original recipient. If set to _true_, the server will attempt to requeue
280
+ the message, potentially then delivering it to an alternative subscriber.
281
+
282
+ =end
283
+
284
+ def recover(opts = {})
285
+
286
+ send_frame(
287
+ Qrack::Protocol::Basic::Recover.new({ :requeue => false }.merge(opts))
288
+ )
289
+
290
+ end
268
291
 
269
292
  private
270
293
 
@@ -50,9 +50,12 @@ ask to confirm a single message or a set of messages up to and including a speci
50
50
 
51
51
  =end
52
52
 
53
- def ack
53
+ def ack(opts={})
54
+ # If delivery tag is nil then set it to 1 to prevent errors
55
+ self.delivery_tag = 1 if self.delivery_tag.nil?
56
+
54
57
  client.send_frame(
55
- Qrack::Protocol::Basic::Ack.new(:delivery_tag => delivery_tag)
58
+ Qrack::Protocol::Basic::Ack.new({:delivery_tag => delivery_tag, :multiple => false}.merge(opts))
56
59
  )
57
60
 
58
61
  # reset delivery tag
@@ -6,7 +6,7 @@ require 'protocol/protocol'
6
6
  require 'transport/buffer'
7
7
  require 'transport/frame'
8
8
 
9
- require 'client'
9
+ require 'qrack/client'
10
10
 
11
11
  module Qrack
12
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-21 00:00:00 +01:00
12
+ date: 2009-05-22 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15