bunny 2.6.0 → 2.6.1

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: 00d3ad97db0f16249b51ccf1471f6b9c19a6a57d
4
- data.tar.gz: 7011427b335e9a4913c180310c1bd3eec7b8f34f
3
+ metadata.gz: d39fdfc39df5c5c84ef856344c2d7242a83b30b7
4
+ data.tar.gz: a55c5f91d3bd260d400e79f1e9b58e93c70c9e73
5
5
  SHA512:
6
- metadata.gz: bc7a6e64cbee2ca138a14df95e7d84248262d1593dbd27832d9b03dbaef6b4d78df06bc5ce1777f313e3dae8f169672b1e8de8f93191e0b39b8e0e087a4898d9
7
- data.tar.gz: fe51e2257d33a5954921cc55bb511ea8496ef2425030077894a098d4eb07efe899f58242be2f2db02e1da007d5d83add2dee03030d0bafd598c8ef61cb140255
6
+ metadata.gz: 0db597e0e7af75a78d584aca113d250f5fa065da89eef1f988d88fa75ca81c7b2ce211f05a28026024c45e3ce32f86c2f958392f831b87fb5fa076bfd58856bd
7
+ data.tar.gz: 03d130d21a488b3d17edb29e08340a0d4429c2324a1c984afa90e667248ff48145efcaac9bcaeaccaa10aabf04211dbdc6c46c6ee7ba92f07bc4fa34fab1ac35
@@ -1,4 +1,16 @@
1
- ## Changes between Bunny 2.5.0 and 2.6.0 (unreleased)
1
+ ## Changes between Bunny 2.6.0 and 2.6.1 (October 23rd, 2016)
2
+
3
+ ### Bunny::ConsumerWorkPool#shutdown Terminates Early When It's Safe to Do So
4
+
5
+ `Bunny::ConsumerWorkPool#shutdown(true)` waited for consumer shutdown
6
+ even if the pool wasn't active (there were no consumers on its
7
+ channel).
8
+
9
+ GitHub issue: [#438](https://github.com/ruby-amqp/bunny/issues/438).
10
+
11
+
12
+
13
+ ## Changes between Bunny 2.5.0 and 2.6.0 (October 15th, 2016)
2
14
 
3
15
  ### Graceful Shutdown of Consumers
4
16
 
@@ -952,7 +952,9 @@ module Bunny
952
952
  @last_basic_cancel_ok = wait_on_continuations
953
953
  end
954
954
 
955
- @work_pool.shutdown(true) unless any_consumers?
955
+ # reduces thread usage for channels that don't have any
956
+ # consumers
957
+ @work_pool.shutdown(true) unless self.any_consumers?
956
958
 
957
959
  @last_basic_cancel_ok
958
960
  end
@@ -57,6 +57,7 @@ module Bunny
57
57
  end
58
58
 
59
59
  def shutdown(wait_for_workers = false)
60
+ was_running = running?
60
61
  @running = false
61
62
 
62
63
  @size.times do
@@ -65,7 +66,7 @@ module Bunny
65
66
  end
66
67
  end
67
68
 
68
- return unless wait_for_workers && @shutdown_timeout
69
+ return if !(wait_for_workers && @shutdown_timeout && was_running)
69
70
 
70
71
  @shutdown_mutex.synchronize do
71
72
  @shutdown_conditional.wait(@shutdown_mutex, @shutdown_timeout)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "2.6.0"
5
+ VERSION = "2.6.1"
6
6
  end
@@ -97,8 +97,10 @@ describe Bunny::Consumer, "#cancel" do
97
97
  sleep 1.0
98
98
 
99
99
  ch = connection.create_channel
100
+ ch.confirm_select
100
101
  ch.default_exchange.publish("", :routing_key => queue_name)
101
- sleep 0.7
102
+ ch.wait_for_confirms
103
+ sleep 0.5
102
104
 
103
105
  consumer.cancel
104
106
  sleep 1.0
@@ -126,8 +128,10 @@ describe Bunny::Consumer, "#cancel" do
126
128
  sleep 1.0
127
129
 
128
130
  ch = connection.create_channel
131
+ ch.confirm_select
129
132
  ch.default_exchange.publish("", :routing_key => queue_name)
130
- sleep 0.7
133
+ ch.wait_for_confirms
134
+ sleep 0.5
131
135
 
132
136
  consumer.cancel
133
137
  sleep 1.0
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: 2.6.0
4
+ version: 2.6.1
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: 2016-10-14 00:00:00.000000000 Z
15
+ date: 2016-10-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol