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: 365d8e6daae12486cdcdba42c0248999f09d2bea
4
- data.tar.gz: 71b9b267986c6e610a77b2a720033deb07b6a2cd
3
+ metadata.gz: b82c6b4d49691f8d77876fcd44a764d811cedf31
4
+ data.tar.gz: c55cf8f7f121af8c24be1df363a0ddde0fab0ec7
5
5
  SHA512:
6
- metadata.gz: b6f0b2bd1dfb4fb8edc1b1e68a8377c9fc16e6f009d92a506407c95086a34e6de86ac281aded3e6ab19e5d208dd464ea734e0b5602cfeaa1f617f9c72aa8d563
7
- data.tar.gz: 52b8288e4b0bcc1642f254211e947dceb9688f16838b2f39ea7bcf85436d91b35432fa0350a7e44a875729ce23f6857161d89063bb04b5cdab28b91ee6593963
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
- exchange = channel.topic(exchange_name)
90
- potentially_retry = []
91
- loop do
92
- break if messages.empty?
93
- message = messages.shift
94
-
95
- fail ActivePublisher::UnknownMessageClassError, "bulk publish messages must be ActivePublisher::Message" unless message.is_a?(ActivePublisher::Message)
96
- fail ActivePublisher::ExchangeMismatchError, "bulk publish messages must match publish_all exchange_name" if message.exchange_name != exchange_name
97
-
98
- begin
99
- options = ::ActivePublisher.publishing_options(message.route, message.options || {})
100
- exchange.publish(message.payload, options)
101
- potentially_retry << message
102
- rescue
103
- messages << message
104
- raise
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)
@@ -1,3 +1,3 @@
1
1
  module ActivePublisher
2
- VERSION = "1.0.0.pre3"
2
+ VERSION = "1.0.0.pre4"
3
3
  end
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.pre3
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-01 00:00:00.000000000 Z
15
+ date: 2017-09-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bunny