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 +4 -4
- data/.travis.yml +3 -2
- data/active_publisher.gemspec +1 -1
- data/lib/active_publisher/connection.rb +23 -0
- data/lib/active_publisher/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a22dd5fbe130fe45df2633fb93b3d9f348010ebbbd57ad10901ff8ef497c772
|
4
|
+
data.tar.gz: a9bdc1b37c19ea0b84d6769e33624d3118c6b6138587e6ca652b6a715a01dfa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66b80f57c49e3bdfbb460956696742450dbe8c214ab3672017b70393767ca70e22b980d92c3df2168b9a162bbd72bb9d2e8a791d37217fe2f239e956762e2fba
|
7
|
+
data.tar.gz: 367add67720237a0ee85514f460b41ceab2633c9729f6676260702eef6709d8e8f8a010fed59f015fac82f64bb8e4dad6ef2b20327032a7d89a1f1f6b6228c47
|
data/.travis.yml
CHANGED
data/active_publisher.gemspec
CHANGED
@@ -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"
|
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
|
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.
|
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-
|
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: '
|
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: '
|
156
|
+
version: '0'
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: rspec
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|