active_publisher 1.0.0.pre3 → 1.0.0.pre4
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: b82c6b4d49691f8d77876fcd44a764d811cedf31
|
4
|
+
data.tar.gz: c55cf8f7f121af8c24be1df363a0ddde0fab0ec7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da0bf3b07ac7f6916a8cebdc7199b019b1efc3ce45182c9f3bf268a1d126acf4d638279b865f08356d4f11a6616d269807cac601204ecaef0d2d148eaa80b5f1
|
7
|
+
data.tar.gz: e5976479239647b1452589a71886d44701b7f6244e94dd8df4d8bd9001793576aa46de104b1d52beabe0926b7c5de21a987cde30f09c93f731d412cdb9068036
|
@@ -86,25 +86,27 @@ module ActivePublisher
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def publish_all(channel, exchange_name, messages)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
89
|
+
::ActiveSupport::Notifications.instrument "message_published.active_publisher", :message_count => messages.size do
|
90
|
+
exchange = channel.topic(exchange_name)
|
91
|
+
potentially_retry = []
|
92
|
+
loop do
|
93
|
+
break if messages.empty?
|
94
|
+
message = messages.shift
|
95
|
+
|
96
|
+
fail ActivePublisher::UnknownMessageClassError, "bulk publish messages must be ActivePublisher::Message" unless message.is_a?(ActivePublisher::Message)
|
97
|
+
fail ActivePublisher::ExchangeMismatchError, "bulk publish messages must match publish_all exchange_name" if message.exchange_name != exchange_name
|
98
|
+
|
99
|
+
begin
|
100
|
+
options = ::ActivePublisher.publishing_options(message.route, message.options || {})
|
101
|
+
exchange.publish(message.payload, options)
|
102
|
+
potentially_retry << message
|
103
|
+
rescue
|
104
|
+
messages << message
|
105
|
+
raise
|
106
|
+
end
|
105
107
|
end
|
108
|
+
wait_for_confirms(channel, messages, potentially_retry)
|
106
109
|
end
|
107
|
-
wait_for_confirms(channel, messages, potentially_retry)
|
108
110
|
end
|
109
111
|
|
110
112
|
def wait_for_confirms(channel, messages, potentially_retry)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Stien
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-09-
|
15
|
+
date: 2017-09-05 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bunny
|