hanami-events-cloud_pubsub 3.0.5 → 3.0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c771a179c93a8264e30f783a31b3c623c301206c587f9fb76f3dfcff9834731
|
4
|
+
data.tar.gz: 6b4b4ec5bbef668fc5fdf3d46a336a1646a440eeaeb68825803211dc6797ac34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd9fdb68cd1a9bfffadd5a55e3656c39e884dfa99f57324dba5b2609309c3077e8a83ed6d9bfe169dd5cf4ead82ab1fbe38c057ac889ae099f7f54aad8304aa0
|
7
|
+
data.tar.gz: 339896e5b18a3396f6988c19b846f6995d1fc3368b5430ff25c5ef5a759c9beac1609715aa2221ce03ea7470c3f769a4b8035a6fdb1198dd420fb4d619ba432f
|
data/Gemfile.lock
CHANGED
@@ -59,7 +59,8 @@ module Hanami
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def shutdown
|
62
|
-
|
62
|
+
stop
|
63
|
+
wait
|
63
64
|
self
|
64
65
|
end
|
65
66
|
|
@@ -68,8 +69,8 @@ module Hanami
|
|
68
69
|
self
|
69
70
|
end
|
70
71
|
|
71
|
-
def wait
|
72
|
-
subscriber.wait!
|
72
|
+
def wait(timeout = 60)
|
73
|
+
subscriber.wait!(timeout)
|
73
74
|
self
|
74
75
|
end
|
75
76
|
|
@@ -9,7 +9,7 @@ module Hanami
|
|
9
9
|
class Runner
|
10
10
|
attr_reader :logger, :adapter
|
11
11
|
|
12
|
-
def initialize(adapter:, logger:, sleep_time:
|
12
|
+
def initialize(adapter:, logger:, sleep_time: 30)
|
13
13
|
@logger = logger
|
14
14
|
@adapter = adapter
|
15
15
|
@sleep_time = sleep_time
|
@@ -40,9 +40,8 @@ module Hanami
|
|
40
40
|
def gracefully_shutdown
|
41
41
|
stop
|
42
42
|
logger.info "Gracefully shutting down CloudPubsub runner: #{self}"
|
43
|
-
|
43
|
+
adapter.listeners.each { |l| l.wait(@sleep_time) }
|
44
44
|
adapter.flush_messages
|
45
|
-
adapter.listeners.each(&:wait)
|
46
45
|
handle_on_shutdown
|
47
46
|
|
48
47
|
self
|
@@ -102,10 +101,6 @@ module Hanami
|
|
102
101
|
MSG
|
103
102
|
end
|
104
103
|
|
105
|
-
def sleep_for_a_bit
|
106
|
-
sleep @sleep_time
|
107
|
-
end
|
108
|
-
|
109
104
|
def handle_on_shutdown
|
110
105
|
return if CloudPubsub.on_shutdown_handlers.empty?
|
111
106
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-events-cloud_pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|