vx-consumer 0.1.4 → 0.1.5
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 +4 -4
- data/.travis.yml +1 -1
- data/lib/vx/consumer/subscribe.rb +5 -4
- data/lib/vx/consumer/version.rb +1 -1
- data/spec/lib/consumer_spec.rb +2 -2
- data/spec/support/test_consumers.rb +0 -1
- data/vx-consumer.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 610088408ab12fdbc3f8254828174a7b99beb24d
|
4
|
+
data.tar.gz: 50aecdec6d9e6dcf43d7ce495615d31c02b0e9dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22051318d00559a878bf3c4b28d9fb9427f2c06f9687b0882ac1bfa6fc978b60bed45e9c23538f85da7b8ac53d1593810aaac6b6c8ddb807ff9f7db1ef4522dd
|
7
|
+
data.tar.gz: 423cad5f9a2f17061e64f6c3faeb4431bc5c37cf76951d163c51659bab33592b2edbdfee94fb20e9dfeabe86b335b0910ba846ad14d5747bdc3282e958278616
|
data/.travis.yml
CHANGED
@@ -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,
|
71
|
+
q = session.declare_queue ch, qname, params.queue_options
|
71
72
|
|
72
73
|
instrumentation.merge!(
|
73
74
|
exchange: x.name,
|
data/lib/vx/consumer/version.rb
CHANGED
data/spec/lib/consumer_spec.rb
CHANGED
@@ -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
|
|
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.
|
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
|
+
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.
|
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.
|
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
|