hanami-events-cloud_pubsub 2.3.1 → 2.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/Gemfile.lock +11 -9
- data/README.md +1 -0
- data/hanami-events-cloud_pubsub.gemspec +1 -1
- data/lib/hanami/events/cloud_pubsub.rb +2 -0
- data/lib/hanami/events/cloud_pubsub/runner.rb +16 -0
- data/lib/hanami/events/cloud_pubsub/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 525c7b860b08011b1ff556378976ea787b0741e310ce7c9a4c4365a9c00f903b
|
|
4
|
+
data.tar.gz: 9deb096c886933568164240c2a3bc16f79d6289cd9b50784ac54c71b73e3db5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 919bee723330e418ef523c9252de6c4740705bdeda96017fcc410fbb932b426f13ba46241090f3757cb3ea3e66accf4e4b3eb5233b64d8dd1512ab556b92a794
|
|
7
|
+
data.tar.gz: b4b9c6280d4e387fcc61bd2cd5f0a2185b816d19e330d3eb1fe26dc97dccc65f1c6e7428a3b06002f601d3bae3aad5e528eadff979835d4e4eafc2db59f4f353
|
data/Gemfile.lock
CHANGED
|
@@ -8,9 +8,9 @@ GIT
|
|
|
8
8
|
PATH
|
|
9
9
|
remote: .
|
|
10
10
|
specs:
|
|
11
|
-
hanami-events-cloud_pubsub (2.
|
|
11
|
+
hanami-events-cloud_pubsub (2.4.0)
|
|
12
12
|
dry-configurable (>= 0.8, < 0.10)
|
|
13
|
-
google-cloud-pubsub (>= 0.38.1, < 1.
|
|
13
|
+
google-cloud-pubsub (>= 0.38.1, < 1.3)
|
|
14
14
|
hanami-cli (~> 0.2)
|
|
15
15
|
hanami-events (~> 0.2.0)
|
|
16
16
|
|
|
@@ -32,13 +32,15 @@ GEM
|
|
|
32
32
|
dry-configurable (~> 0.1, >= 0.1.3)
|
|
33
33
|
dry-core (0.4.9)
|
|
34
34
|
concurrent-ruby (~> 1.0)
|
|
35
|
-
faraday (0.17.
|
|
35
|
+
faraday (0.17.3)
|
|
36
36
|
multipart-post (>= 1.2, < 3)
|
|
37
|
-
google-cloud-core (1.
|
|
37
|
+
google-cloud-core (1.5.0)
|
|
38
38
|
google-cloud-env (~> 1.0)
|
|
39
|
+
google-cloud-errors (~> 1.0)
|
|
39
40
|
google-cloud-env (1.3.0)
|
|
40
41
|
faraday (~> 0.11)
|
|
41
|
-
google-cloud-
|
|
42
|
+
google-cloud-errors (1.0.0)
|
|
43
|
+
google-cloud-pubsub (1.2.1)
|
|
42
44
|
concurrent-ruby (~> 1.1)
|
|
43
45
|
google-cloud-core (~> 1.2)
|
|
44
46
|
google-gax (~> 1.8)
|
|
@@ -65,7 +67,7 @@ GEM
|
|
|
65
67
|
multi_json (~> 1.11)
|
|
66
68
|
os (>= 0.9, < 2.0)
|
|
67
69
|
signet (~> 0.12)
|
|
68
|
-
grpc (1.
|
|
70
|
+
grpc (1.26.0)
|
|
69
71
|
google-protobuf (~> 3.8)
|
|
70
72
|
googleapis-common-protos-types (~> 1.0)
|
|
71
73
|
grpc-google-iam-v1 (0.6.9)
|
|
@@ -74,7 +76,7 @@ GEM
|
|
|
74
76
|
hanami-cli (0.3.1)
|
|
75
77
|
concurrent-ruby (~> 1.0)
|
|
76
78
|
hanami-utils (~> 1.3)
|
|
77
|
-
hanami-utils (1.3.
|
|
79
|
+
hanami-utils (1.3.6)
|
|
78
80
|
concurrent-ruby (~> 1.0)
|
|
79
81
|
transproc (~> 1.0)
|
|
80
82
|
jaro_winkler (1.5.3)
|
|
@@ -91,7 +93,7 @@ GEM
|
|
|
91
93
|
pry (0.12.2)
|
|
92
94
|
coderay (~> 1.1.0)
|
|
93
95
|
method_source (~> 0.9.0)
|
|
94
|
-
public_suffix (4.0.
|
|
96
|
+
public_suffix (4.0.3)
|
|
95
97
|
rainbow (3.0.0)
|
|
96
98
|
rake (13.0.0)
|
|
97
99
|
rly (0.2.3)
|
|
@@ -126,7 +128,7 @@ GEM
|
|
|
126
128
|
json (>= 1.8, < 3)
|
|
127
129
|
simplecov-html (~> 0.10.0)
|
|
128
130
|
simplecov-html (0.10.2)
|
|
129
|
-
transproc (1.1.
|
|
131
|
+
transproc (1.1.1)
|
|
130
132
|
unicode-display_width (1.6.0)
|
|
131
133
|
|
|
132
134
|
PLATFORMS
|
data/README.md
CHANGED
|
@@ -32,6 +32,7 @@ Hanami.configure do
|
|
|
32
32
|
config.namespace = :staging # optional
|
|
33
33
|
config.auto_create_topics = false # optional
|
|
34
34
|
config.auto_create_subscriptions = false # optional
|
|
35
|
+
config.on_shutdown = ->(adapter) { Analytics.flush } # optional
|
|
35
36
|
config.error_handlers << ->(err, message) { MyErrorReporter.report(err) }
|
|
36
37
|
# ...
|
|
37
38
|
end
|
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
25
|
spec.add_dependency 'dry-configurable', '>= 0.8', '< 0.10'
|
|
26
|
-
spec.add_dependency 'google-cloud-pubsub', '>= 0.38.1', '< 1.
|
|
26
|
+
spec.add_dependency 'google-cloud-pubsub', '>= 0.38.1', '< 1.3'
|
|
27
27
|
spec.add_dependency 'hanami-cli', '~> 0.2'
|
|
28
28
|
spec.add_dependency 'hanami-events', '~> 0.2.0'
|
|
29
29
|
|
|
@@ -42,6 +42,8 @@ module Hanami
|
|
|
42
42
|
sleep_for_a_bit
|
|
43
43
|
adapter.flush_messages
|
|
44
44
|
adapter.listeners.each(&:wait)
|
|
45
|
+
handle_on_shutdown
|
|
46
|
+
|
|
45
47
|
self
|
|
46
48
|
end
|
|
47
49
|
|
|
@@ -104,6 +106,20 @@ module Hanami
|
|
|
104
106
|
def sleep_for_a_bit
|
|
105
107
|
sleep @sleep_time
|
|
106
108
|
end
|
|
109
|
+
|
|
110
|
+
def handle_on_shutdown
|
|
111
|
+
return if CloudPubsub.on_shutdown_handlers.empty?
|
|
112
|
+
|
|
113
|
+
logger.info('Calling custom on_shutdown handler')
|
|
114
|
+
|
|
115
|
+
CloudPubsub.on_shutdown_handlers.each do |handler|
|
|
116
|
+
begin
|
|
117
|
+
handler.call(adapter)
|
|
118
|
+
rescue StandardError => e
|
|
119
|
+
logger.warn("Shutdown handler failed (#{e.message})")
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
107
123
|
end
|
|
108
124
|
end
|
|
109
125
|
end
|
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: 2.
|
|
4
|
+
version: 2.4.0
|
|
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:
|
|
11
|
+
date: 2020-01-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dry-configurable
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
version: 0.38.1
|
|
40
40
|
- - "<"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '1.
|
|
42
|
+
version: '1.3'
|
|
43
43
|
type: :runtime
|
|
44
44
|
prerelease: false
|
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -49,7 +49,7 @@ dependencies:
|
|
|
49
49
|
version: 0.38.1
|
|
50
50
|
- - "<"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '1.
|
|
52
|
+
version: '1.3'
|
|
53
53
|
- !ruby/object:Gem::Dependency
|
|
54
54
|
name: hanami-cli
|
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|