twingly-amqp 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/twingly/amqp/publisher.rb +1 -0
- data/lib/twingly/amqp/subscription.rb +5 -1
- data/lib/twingly/amqp/utilities.rb +13 -0
- data/lib/twingly/amqp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 22f68bea1937074e780202bd8bc23dd73309403d1c185ab8b401820b312bb067
|
|
4
|
+
data.tar.gz: ba7c0073d34cf169c7265e62efcef171a3aa5a425f6fce70374788c578db3e8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80e8d58eccf8b94a7a00c0f3b81eb207621a6cde71f7751da453c1501aaca2eb194b6685e7ad2258217425383d76a2e18484d52a0d7fa1a2a90446c8369bab85
|
|
7
|
+
data.tar.gz: c755621c4cf4a3e49e48e458192716c64711d32faca5b1508843f6f29ea07c61d0ceb5e37ebb525e162ee4e8e3ece6538adf376b6c792fd76dcec1946e9d7222
|
|
@@ -39,10 +39,14 @@ module Twingly
|
|
|
39
39
|
|
|
40
40
|
def each_message(blocking: true, &block)
|
|
41
41
|
@blocking = blocking
|
|
42
|
+
Utilities.raise_if_connection_failed(@channel.connection)
|
|
42
43
|
@consumer = create_consumer(&block)
|
|
43
44
|
|
|
44
45
|
if @blocking
|
|
45
|
-
|
|
46
|
+
until cancel?
|
|
47
|
+
Utilities.raise_if_connection_failed(@channel.connection)
|
|
48
|
+
sleep 0.01
|
|
49
|
+
end
|
|
46
50
|
|
|
47
51
|
@consumer.cancel
|
|
48
52
|
end
|
|
@@ -16,6 +16,19 @@ module Twingly
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
|
+
|
|
20
|
+
# Bunny 3 stores errors that stop its reader loop instead of raising them, so a dead
|
|
21
|
+
# connection still looks open. The error is left in place so every caller fails, and a
|
|
22
|
+
# copy is raised so each one gets its own backtrace.
|
|
23
|
+
def self.raise_if_connection_failed(connection)
|
|
24
|
+
return unless defined?(Bunny::ExceptionAccumulator) && connection.respond_to?(:session_error_handler)
|
|
25
|
+
|
|
26
|
+
handler = connection.session_error_handler
|
|
27
|
+
return unless handler.is_a?(Bunny::ExceptionAccumulator)
|
|
28
|
+
|
|
29
|
+
error = handler.all.first
|
|
30
|
+
raise error.dup if error
|
|
31
|
+
end
|
|
19
32
|
end
|
|
20
33
|
end
|
|
21
34
|
end
|
data/lib/twingly/amqp/version.rb
CHANGED