vx-consumer 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98dc0b2f078519ea2ccf52a5467cdfbebce98652
4
- data.tar.gz: 405b389c6672e9ce777c44759e2b7422aa4d1555
3
+ metadata.gz: 4831500045ec9daf6df86cb54c7309d1100cd2e7
4
+ data.tar.gz: 73621a7d5bd60cc50c60caa826e795162ea2a4b4
5
5
  SHA512:
6
- metadata.gz: c880219d1bd3c939a1a0a217b36053447736ed054b7b05bb00f15c00ad23d9a88395260b407e54c7a44619b1ad7150ad0c4d4ec5231ea8517e95ba4749cb8a2c
7
- data.tar.gz: ecff22e7ec25e566353fb6526dca1f967c6f3bae88d827d7efcb707abbfc2433db413166bb471c9dce42a9a0c6870b4a713e0bf3ae7fc6ffc19182eaea2076ae
6
+ metadata.gz: e35ec88e940e4b3b09ae7aaff4ee281f92d7bc8368d6c2d50b610a8171c61bbb6987aff77523116dd3733d5931ebdd1639502fad20cbf05994db27b2c543f53f
7
+ data.tar.gz: 38357a1ee1b91f8aaa0d2014dc6c4ca5911fecd1a3278fa30a91e25a3b546e9450a38b7744b36985b393c8a727f80c754e4f99dc9b875c510e9fad92e81bf137
@@ -42,8 +42,11 @@ module Vx
42
42
  end
43
43
 
44
44
  def wait_shutdown
45
- Consumer.wait_shutdown
46
- cancel
45
+ Thread.new do
46
+ Thread.current.abort_on_exception = true
47
+ Consumer.wait_shutdown
48
+ cancel
49
+ end
47
50
  end
48
51
 
49
52
  end
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Consumer
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -89,20 +89,21 @@ describe Vx::Consumer do
89
89
  end
90
90
 
91
91
  it "should wait shutdown" do
92
- consumer = Bob.subscribe
92
+ bob1 = Bob.subscribe
93
+ bob2 = Bob.subscribe
93
94
  Bob.publish a: 1
95
+ Bob.publish a: 2
94
96
 
95
- th = Thread.new {
96
- consumer.wait_shutdown
97
- }
97
+ th1 = bob1.wait_shutdown
98
+ th2 = bob2.wait_shutdown
98
99
  sleep 0.2
99
100
  Vx::Consumer.shutdown
100
101
 
101
102
  Timeout.timeout(1) do
102
- th.join
103
+ [th1, th2].map(&:join)
103
104
  end
104
105
 
105
- expect(Bob._collected).to eq(["a" => 1])
106
+ expect(Bob._collected.map(&:values).flatten.sort).to eq [1,2]
106
107
  end
107
108
 
108
109
  it "should work with graceful shutdown" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny