multiple_man 1.6.2 → 1.7.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de8e558c5c32b34097bff7821809620ae243b3bd
|
4
|
+
data.tar.gz: 0abbc36ff9201341a009747f32b31a87777b5a25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2b755067fbf63b2a0611da6db2d375536a4fae2a12cd46da67cf31902815c9f647ad89217cc9e57ba857a3b3a54df313980c04dc53415e64490f21ea3773151
|
7
|
+
data.tar.gz: 2cb2117444d531ca7521a2ec3526c1a8f122bd80c72435c0b822ea36f764cb2f2164519eab1a9348054f9b18e4a2a705ce8b995612730cb0fd4862713ea785ac
|
data/lib/multiple_man.rb
CHANGED
@@ -15,6 +15,7 @@ module MultipleMan
|
|
15
15
|
require 'multiple_man/subscribers/base'
|
16
16
|
require 'multiple_man/subscribers/model_subscriber'
|
17
17
|
require 'multiple_man/subscribers/registry'
|
18
|
+
require 'multiple_man/tracers/null_tracer'
|
18
19
|
require 'multiple_man/configuration'
|
19
20
|
require 'multiple_man/model_publisher'
|
20
21
|
require 'multiple_man/attribute_extractor'
|
@@ -14,7 +14,7 @@ module MultipleMan
|
|
14
14
|
:queue_name, :prefetch_size, :bunny_opts, :exchange_opts,
|
15
15
|
:publisher_confirms
|
16
16
|
|
17
|
-
attr_writer :logger
|
17
|
+
attr_writer :logger, :tracer
|
18
18
|
|
19
19
|
def initialize
|
20
20
|
self.topic_name = "multiple_man"
|
@@ -43,6 +43,10 @@ module MultipleMan
|
|
43
43
|
@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
44
44
|
end
|
45
45
|
|
46
|
+
def tracer
|
47
|
+
@tracer ||= ::MultipleMan::Tracers::NullTracer
|
48
|
+
end
|
49
|
+
|
46
50
|
def on_error(&block)
|
47
51
|
@error_handler = block
|
48
52
|
end
|
@@ -32,9 +32,8 @@ module MultipleMan
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def receive(delivery_info,
|
36
|
-
|
37
|
-
dispatch_subscribers(message, method, delivery_info.routing_key)
|
35
|
+
def receive(delivery_info, meta_data, message)
|
36
|
+
dispatch_subscribers(delivery_info, meta_data, message)
|
38
37
|
queue.channel.acknowledge(delivery_info.delivery_tag, false)
|
39
38
|
|
40
39
|
MultipleMan.logger.debug "Successfully processed! #{delivery_info.routing_key}"
|
@@ -48,12 +47,13 @@ module MultipleMan
|
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
51
|
-
def dispatch_subscribers(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
def dispatch_subscribers(delivery_info, meta_data, message)
|
51
|
+
method = operation(message, delivery_info.routing_key)
|
52
|
+
|
53
|
+
subscribers.select { |k,s| k.match(delivery_info.routing_key) }.values.each do |s|
|
54
|
+
tracer = MultipleMan.configuration.tracer.new(s)
|
55
|
+
tracer.handle(delivery_info, meta_data, message, method)
|
56
|
+
end
|
57
57
|
end
|
58
58
|
|
59
59
|
def operation(message, routing_key)
|
data/lib/multiple_man/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiple_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brunner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/multiple_man/subscribers/model_subscriber.rb
|
136
136
|
- lib/multiple_man/subscribers/registry.rb
|
137
137
|
- lib/multiple_man/tasks/worker.rake
|
138
|
+
- lib/multiple_man/tracers/null_tracer.rb
|
138
139
|
- lib/multiple_man/version.rb
|
139
140
|
- multiple_man.gemspec
|
140
141
|
- spec/attribute_extractor_spec.rb
|