hanami-events-cloud_pubsub 2.1.2 → 2.1.3
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: 9b535cead0f43738abd37ba5487c71c04fe58dfc0af3c22cc0860f86ca8c3036
|
4
|
+
data.tar.gz: 2b0175b75fa4caed47c2b592a674b39ccd2ee392adf715a52211a70b4a633ba2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8916a647db7d0d14c8b56fa3e359fc553cb022d28b989de6f1442aaa18dd96605f16eb089dec0ccdcb0aea9f6730c950907e3fd5b6bae8c801c194f87c61a7b
|
7
|
+
data.tar.gz: 3002bd4edceba5fd9a85dfbd0b0e58407283775b37cf301e97a08f95c2a13bf1257ab274d7aedea1ad44c5da42ac1e7ae46cb0b7a35c82051a167ec630ac95a4
|
data/Gemfile.lock
CHANGED
@@ -82,7 +82,6 @@ module Hanami
|
|
82
82
|
data = message.data
|
83
83
|
payload = serializer.deserialize(data)
|
84
84
|
event_name = message.attributes['event_name']
|
85
|
-
payload['id'] = message.attributes['id']
|
86
85
|
|
87
86
|
@subscribers.each do |subscriber|
|
88
87
|
subscriber.call(event_name, payload)
|
@@ -93,6 +92,7 @@ module Hanami
|
|
93
92
|
@serializer ||= Hanami::Events::Serializer[@serializer_type].new
|
94
93
|
end
|
95
94
|
|
95
|
+
# rubocop:disable Metrics/LineLength
|
96
96
|
def topic_for(name)
|
97
97
|
@topic_registry[name.to_s] ||= begin
|
98
98
|
@pubsub.find_topic(name) ||
|
@@ -100,6 +100,7 @@ module Hanami
|
|
100
100
|
raise(CloudPubsub::Errors::TopicNotFoundError, "no topic named: #{name}")
|
101
101
|
end
|
102
102
|
end
|
103
|
+
# rubocop:enable Metrics/LineLength
|
103
104
|
|
104
105
|
def namespaced(val, sep: '.')
|
105
106
|
[Hanami::Events::CloudPubsub.namespace, val].compact.join(sep)
|
@@ -17,6 +17,7 @@ module Hanami
|
|
17
17
|
:event_name,
|
18
18
|
:subscriber_opts,
|
19
19
|
:middleware
|
20
|
+
# rubocop:disable Metrics/ParameterLists
|
20
21
|
def initialize(topic:,
|
21
22
|
logger:,
|
22
23
|
handler:,
|
@@ -32,6 +33,7 @@ module Hanami
|
|
32
33
|
@subscriber_opts = CloudPubsub.config.subscriber.to_h.merge(subscriber_opts)
|
33
34
|
@middleware = middleware
|
34
35
|
end
|
36
|
+
# rubocop:enable Metrics/ParameterLists
|
35
37
|
|
36
38
|
def register
|
37
39
|
subscription = subscription_for(subscriber_id)
|
@@ -40,14 +40,14 @@ module Hanami
|
|
40
40
|
@entries.shift
|
41
41
|
end
|
42
42
|
|
43
|
-
def invoke(
|
43
|
+
def invoke(message)
|
44
44
|
stack = entries.dup
|
45
45
|
|
46
46
|
traverse_stack = proc do |**opts|
|
47
47
|
if stack.empty?
|
48
|
-
yield(
|
48
|
+
yield(message)
|
49
49
|
else
|
50
|
-
stack.shift.call(
|
50
|
+
stack.shift.call(message, **opts, &traverse_stack)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
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.1.
|
4
|
+
version: 2.1.3
|
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: 2019-03-
|
11
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|