bunny 1.0.0.pre6 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2300a08d4b91b185b601971711c302e444ed42b
4
- data.tar.gz: 0b02b296187c972d00e9a355eda453009ba29842
3
+ metadata.gz: c339ebb8c3d6a344a35638a8c685e7e5986719e1
4
+ data.tar.gz: e59fed7a29900b78dcaa9bf9e67ecb7824948054
5
5
  SHA512:
6
- metadata.gz: ec12d8260233fb4def78ea75030fb201a083d574530fae276b4c035071b4d38a206c0dd0060067843e1b55bd81cc92b2faf668bc7faafc0a72bb2915251d6138
7
- data.tar.gz: ad3b8d18e8bf7e0d04b1a6a5770ef1734e320b2fa15efc439e90482cbd7226804bc6ebf29e9525404c1b7e4d4f75141e761c39732ff946c883dd826782253518
6
+ metadata.gz: 4172c0cf99d0fca5c2c5fa40d07a5ad82be055dea6867a4d19ecd54599059ea9a0ec16f317083ab4b27d0ad807159b57e5bbccf23440a1f5ef3a3bf3ee8baf08
7
+ data.tar.gz: e0d292b13d4bed1cb5bf046453dd11ad3562359364d0ee9c15ff4934ebaee461344c087ea63fa31e43f5fd56f0af8d2f54375c1cc7217c454aa3b55cfb873b89
@@ -1,3 +1,17 @@
1
+ ## Changes between Bunny 1.0.0.pre6 and 1.0.0.pre7
2
+
3
+ ### amq-protocol Update
4
+
5
+ Minimum `amq-protocol` version is now `1.8.0` which includes
6
+ a bug fix for messages exactly 128 Kb in size.
7
+
8
+
9
+ ### Add timeout Bunny::ConsumerWorkPool#join
10
+
11
+ `Bunny::ConsumerWorkPool#join` now accepts an optional
12
+ timeout argument.
13
+
14
+
1
15
  ## Changes between Bunny 1.0.0.pre5 and 1.0.0.pre6
2
16
 
3
17
  ### Respect RABBITMQ_URL value
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  map { |mail| Base64.decode64(mail) }
30
30
 
31
31
  # Dependencies
32
- s.add_dependency "amq-protocol", ">= 1.7.0"
32
+ s.add_dependency "amq-protocol", ">= 1.8.0"
33
33
 
34
34
  # Files.
35
35
  s.has_rdoc = true
@@ -4,6 +4,8 @@ module Bunny
4
4
  # Thread pool that dispatches consumer deliveries. Not supposed to be shared between channels
5
5
  # or threads.
6
6
  #
7
+ # Every channel its own consumer pool.
8
+ #
7
9
  # @private
8
10
  class ConsumerWorkPool
9
11
 
@@ -11,6 +13,7 @@ module Bunny
11
13
  # API
12
14
  #
13
15
 
16
+ attr_reader :threads
14
17
  attr_reader :size
15
18
 
16
19
  def initialize(size = 1)
@@ -48,8 +51,8 @@ module Bunny
48
51
  end
49
52
  end
50
53
 
51
- def join
52
- @threads.each { |t| t.join }
54
+ def join(timeout = nil)
55
+ @threads.each { |t| t.join(timeout) }
53
56
  end
54
57
 
55
58
  def pause
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "1.0.0.pre6"
5
+ VERSION = "1.0.0.rc1"
6
6
  end
@@ -0,0 +1,54 @@
1
+ require "spec_helper"
2
+ require "set"
3
+
4
+ describe Bunny::Queue, "#subscribe_with" do
5
+ let(:connection) do
6
+ c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
7
+ c.start
8
+ c
9
+ end
10
+
11
+ after :each do
12
+ connection.close if connection.open?
13
+ end
14
+
15
+ context "with explicit acknowledgements mode" do
16
+ class ExampleConsumer < Bunny::Consumer
17
+ def cancelled?
18
+ @cancelled
19
+ end
20
+
21
+ def handle_cancellation(_)
22
+ @cancelled = true
23
+ end
24
+
25
+ def call(delivery_info, metadata, payload)
26
+ # no-op
27
+ end
28
+ end
29
+
30
+ # demonstrates that manual acknowledgement mode is actually
31
+ # used. MK.
32
+ it "requeues messages on channel closure" do
33
+ ch1 = connection.create_channel
34
+ ch2 = connection.create_channel
35
+ q1 = ch1.queue("bunny.tests.consumer_object1", :exclusive => true)
36
+ q2 = ch2.queue("bunny.tests.consumer_object1", :exclusive => true)
37
+ ec = ExampleConsumer.new(ch1, q1, "", false)
38
+ x = ch2.default_exchange
39
+
40
+ t = Thread.new do
41
+ 50.times do
42
+ x.publish("hello", :routing_key => q2.name)
43
+ end
44
+ end
45
+ t.abort_on_exception = true
46
+
47
+ q1.subscribe_with(ec, :ack => true)
48
+ sleep 2
49
+ ch1.close
50
+
51
+ q2.message_count.should == 50
52
+ end
53
+ end
54
+ end
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: 1.0.0.pre6
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-09-05 00:00:00.000000000 Z
15
+ date: 2013-10-01 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol
@@ -20,14 +20,14 @@ dependencies:
20
20
  requirements:
21
21
  - - '>='
22
22
  - !ruby/object:Gem::Version
23
- version: 1.7.0
23
+ version: 1.8.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - '>='
29
29
  - !ruby/object:Gem::Version
30
- version: 1.7.0
30
+ version: 1.8.0
31
31
  description: Easy to use, feature complete Ruby client for RabbitMQ 2.0 and later
32
32
  versions.
33
33
  email:
@@ -134,6 +134,7 @@ files:
134
134
  - spec/higher_level_api/integration/basic_ack_spec.rb
135
135
  - spec/higher_level_api/integration/basic_cancel_spec.rb
136
136
  - spec/higher_level_api/integration/basic_consume_spec.rb
137
+ - spec/higher_level_api/integration/basic_consume_with_objects_spec.rb
137
138
  - spec/higher_level_api/integration/basic_get_spec.rb
138
139
  - spec/higher_level_api/integration/basic_nack_spec.rb
139
140
  - spec/higher_level_api/integration/basic_publish_spec.rb
@@ -226,6 +227,7 @@ test_files:
226
227
  - spec/higher_level_api/integration/basic_ack_spec.rb
227
228
  - spec/higher_level_api/integration/basic_cancel_spec.rb
228
229
  - spec/higher_level_api/integration/basic_consume_spec.rb
230
+ - spec/higher_level_api/integration/basic_consume_with_objects_spec.rb
229
231
  - spec/higher_level_api/integration/basic_get_spec.rb
230
232
  - spec/higher_level_api/integration/basic_nack_spec.rb
231
233
  - spec/higher_level_api/integration/basic_publish_spec.rb