active_publisher 1.2.1 → 1.2.2

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
  SHA256:
3
- metadata.gz: 982d3b5383cab0a20bdf603ba20204988ebef61f0ac7d5a491eb472f4eb205e3
4
- data.tar.gz: 7e50b3a2fdb76ecfb92b2c76d8bd18d8b753fb08f1ac31400095e077ca364f76
3
+ metadata.gz: 0a22dd5fbe130fe45df2633fb93b3d9f348010ebbbd57ad10901ff8ef497c772
4
+ data.tar.gz: a9bdc1b37c19ea0b84d6769e33624d3118c6b6138587e6ca652b6a715a01dfa8
5
5
  SHA512:
6
- metadata.gz: 256b09515fd4c47c1f57b2e725876cbc0c6a82d81ca1f575cc34682b29a0a74cf18d5725f431e105201ac5fe7e7a43ff54ba0b11d8c761d47a788d66bd422f9d
7
- data.tar.gz: a4fc04ddf398998435e0b44284a3e6dc45b7909067ce5640159fabdc8edb5bb9b8a35f0ee57673bf4bd15bc1dd8838889b7ed29f1614c0573296e0c554818e99
6
+ metadata.gz: 66b80f57c49e3bdfbb460956696742450dbe8c214ab3672017b70393767ca70e22b980d92c3df2168b9a162bbd72bb9d2e8a791d37217fe2f239e956762e2fba
7
+ data.tar.gz: 367add67720237a0ee85514f460b41ceab2633c9729f6676260702eef6709d8e8f8a010fed59f015fac82f64bb8e4dad6ef2b20327032a7d89a1f1f6b6228c47
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3
4
- - 2.4
3
+ - 2.3.8
4
+ - 2.5.7
5
5
  - jruby-9.1.12.0
6
+ - jruby-9.2.7.0
6
7
  addons:
7
8
  apt:
8
9
  packages:
@@ -35,6 +35,6 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "connection_pool"
36
36
  spec.add_development_dependency "fakeredis"
37
37
  spec.add_development_dependency "pry"
38
- spec.add_development_dependency "rake", "~> 10.0"
38
+ spec.add_development_dependency "rake"
39
39
  spec.add_development_dependency "rspec", "~> 3.2"
40
40
  end
@@ -31,9 +31,22 @@ module ActivePublisher
31
31
  def self.create_connection
32
32
  if ::RUBY_PLATFORM == "java"
33
33
  connection = ::MarchHare.connect(connection_options)
34
+ connection.on_blocked do |reason|
35
+ on_blocked(reason)
36
+ end
37
+ connection.on_unblocked do
38
+ on_unblocked
39
+ end
40
+ connection
34
41
  else
35
42
  connection = ::Bunny.new(connection_options)
36
43
  connection.start
44
+ connection.on_blocked do |blocked_message|
45
+ on_blocked(blocked_message.reason)
46
+ end
47
+ connection.on_unblocked do
48
+ on_unblocked
49
+ end
37
50
  connection
38
51
  end
39
52
  end
@@ -58,5 +71,15 @@ module ActivePublisher
58
71
  }
59
72
  end
60
73
  private_class_method :connection_options
74
+
75
+ def self.on_blocked(reason)
76
+ ::ActiveSupport::Notifications.instrument("connection_blocked.active_publisher", :reason => reason)
77
+ end
78
+ private_class_method :on_blocked
79
+
80
+ def self.on_unblocked
81
+ ::ActiveSupport::Notifications.instrument("connection_unblocked.active_publisher")
82
+ end
83
+ private_class_method :on_unblocked
61
84
  end
62
85
  end
@@ -1,3 +1,3 @@
1
1
  module ActivePublisher
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
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.2.1
4
+ version: 1.2.2
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: 2020-04-17 00:00:00.000000000 Z
15
+ date: 2020-05-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bunny
@@ -144,16 +144,16 @@ dependencies:
144
144
  name: rake
145
145
  requirement: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - "~>"
147
+ - - ">="
148
148
  - !ruby/object:Gem::Version
149
- version: '10.0'
149
+ version: '0'
150
150
  type: :development
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
- - - "~>"
154
+ - - ">="
155
155
  - !ruby/object:Gem::Version
156
- version: '10.0'
156
+ version: '0'
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: rspec
159
159
  requirement: !ruby/object:Gem::Requirement