vx-consumer 0.1.4 → 0.1.5

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: 855e8429df6a59a3a5ef9343411369be93f3af1a
4
- data.tar.gz: 0c7df3bf9e3cc3efca543a5f09ecd0051c209f0c
3
+ metadata.gz: 610088408ab12fdbc3f8254828174a7b99beb24d
4
+ data.tar.gz: 50aecdec6d9e6dcf43d7ce495615d31c02b0e9dd
5
5
  SHA512:
6
- metadata.gz: 4fcb5d02ba1364f8717e07bc34da09417e73ddffa5b1b4cc851c97822250215a81e66eb8bc8017e42376e58068ea27940528ae38aed426074d021ada219154bd
7
- data.tar.gz: b1d57a0b754c90455467b0550086def194a1b790a079a428f4add5bb7be569e30c11da33c7ddc5b4f3c9ef09f24708a15c097ae228ea6be29c52fe82b002dcbe
6
+ metadata.gz: 22051318d00559a878bf3c4b28d9fb9427f2c06f9687b0882ac1bfa6fc978b60bed45e9c23538f85da7b8ac53d1593810aaac6b6c8ddb807ff9f7db1ef4522dd
7
+ data.tar.gz: 423cad5f9a2f17061e64f6c3faeb4431bc5c37cf76951d163c51659bab33592b2edbdfee94fb20e9dfeabe86b335b0910ba846ad14d5747bdc3282e958278616
data/.travis.yml CHANGED
@@ -10,4 +10,4 @@ matrix:
10
10
  allow_failures:
11
11
  - rvm: jruby
12
12
 
13
- script: bundle exec rspec spec/
13
+ script: bundle exec rspec spec/ -b
@@ -2,8 +2,8 @@ module Vx
2
2
  module Consumer
3
3
  module Subscribe
4
4
 
5
- def subscribe
6
- ch, q = bind
5
+ def subscribe(options = {})
6
+ ch, q = bind(options)
7
7
 
8
8
  subscriber = Subscriber.new(
9
9
  ch,
@@ -54,7 +54,8 @@ module Vx
54
54
  Serializer.unpack(properties[:content_type], payload, params.model)
55
55
  end
56
56
 
57
- def bind
57
+ def bind(options = {})
58
+ qname = options[:queue] || params.queue_options
58
59
 
59
60
  instrumentation = {
60
61
  consumer: params.consumer_name
@@ -67,7 +68,7 @@ module Vx
67
68
  ch.prefetch configuration.prefetch
68
69
 
69
70
  x = session.declare_exchange ch, params.exchange_name, params.exchange_options
70
- q = session.declare_queue ch, params.queue_name, params.queue_options
71
+ q = session.declare_queue ch, qname, params.queue_options
71
72
 
72
73
  instrumentation.merge!(
73
74
  exchange: x.name,
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module Consumer
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
@@ -52,7 +52,7 @@ describe Vx::Consumer do
52
52
  it "pub/sub in multithreaded environment" do
53
53
  handle_errors do
54
54
  cns = []
55
- 30.times do
55
+ 30.times do |n|
56
56
  cns << Bob.subscribe
57
57
  end
58
58
 
@@ -70,7 +70,7 @@ describe Vx::Consumer do
70
70
  end
71
71
  cns.map(&:cancel)
72
72
 
73
- expect(Bob._collected.map{|c| c["a"] }.sort).to eq((0...90).to_a)
73
+ expect(Bob._collected.map{|c| c["a"] }.uniq.sort).to eq((0...90).to_a)
74
74
  end
75
75
  end
76
76
 
@@ -5,7 +5,6 @@ class Alice
5
5
 
6
6
  content_type 'text/plain'
7
7
  routing_key 'mykey'
8
-
9
8
  fanout
10
9
 
11
10
  end
data/vx-consumer.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'bunny', '= 1.2.2'
21
+ spec.add_runtime_dependency 'bunny', '= 1.3.0'
22
22
  spec.add_runtime_dependency 'vx-common-rack-builder', '>= 0.0.2'
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.5"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.2
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.2
26
+ version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: vx-common-rack-builder
29
29
  requirement: !ruby/object:Gem::Requirement