evt-consumer 2.2.0.2 → 2.3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/consumer/consumer.rb +14 -4
- data/lib/consumer/controls.rb +3 -1
- data/lib/consumer/controls/consumer.rb +8 -0
- data/lib/consumer/controls/consumer/error_handler.rb +1 -1
- data/lib/consumer/controls/get/incrementing.rb +4 -0
- data/lib/consumer/controls/handle/settings.rb +26 -0
- data/lib/consumer/controls/position_store.rb +29 -12
- data/lib/consumer/controls/settings.rb +13 -0
- data/lib/consumer/position_store.rb +3 -0
- data/lib/consumer/position_store/substitute.rb +2 -0
- data/lib/consumer/subscription.rb +1 -1
- data/lib/consumer/subscription/defaults.rb +3 -0
- metadata +8 -9
- data/lib/consumer/controls/stream_name.rb +0 -6
- data/lib/consumer/postgres +0 -1
- data/lib/consumer/postgres.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 017c30298e5d8a0a9fe23fa86e09c44323e1a22d52e3663969747a02e2436146
|
4
|
+
data.tar.gz: 29bd3ab2d3024ab66821a5234e7195e669fc1ae2425ca5eed29261ff7dedc366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 456d640e41bf8ed1a4d5fe81f81158eb49bb74d49447765d29c9e4d30f085506d36357724b6dd05d2b9a9241e5644d005e46993df344439f1b37a19efd81afb2
|
7
|
+
data.tar.gz: 35a6285dfe925119da75328deef4f4d58d8ce94e8a0bdfb0d250f1a3a21e4815dc0511e7b603f29cd6956a302785a9af6531b91d334a41b772471ad737a4c5fc
|
data/lib/consumer/consumer.rb
CHANGED
@@ -37,6 +37,8 @@ module Consumer
|
|
37
37
|
|
38
38
|
attr_accessor :session
|
39
39
|
|
40
|
+
attr_accessor :supplemental_settings
|
41
|
+
|
40
42
|
dependency :get, MessageStore::Get
|
41
43
|
dependency :position_store, PositionStore
|
42
44
|
dependency :subscription, Subscription
|
@@ -87,7 +89,7 @@ module Consumer
|
|
87
89
|
|
88
90
|
print_startup_info if respond_to?(:print_startup_info)
|
89
91
|
|
90
|
-
STDOUT.puts " Position
|
92
|
+
STDOUT.puts " Position Location: #{position_store.location || '(none)'}"
|
91
93
|
|
92
94
|
STDOUT.puts
|
93
95
|
|
@@ -119,7 +121,7 @@ module Consumer
|
|
119
121
|
logger.trace(tags: [:consumer, :dispatch, :message]) { "Dispatching message (#{LogText.message_data(message_data)})" }
|
120
122
|
|
121
123
|
self.class.handler_registry.each do |handler|
|
122
|
-
handler.(message_data, session: session)
|
124
|
+
handler.(message_data, session: session, settings: supplemental_settings)
|
123
125
|
end
|
124
126
|
|
125
127
|
update_position(message_data.global_position)
|
@@ -172,13 +174,21 @@ module Consumer
|
|
172
174
|
end
|
173
175
|
|
174
176
|
module Build
|
175
|
-
def build(category, position_update_interval: nil, poll_interval_milliseconds: nil, identifier: nil, **arguments)
|
177
|
+
def build(category, position_update_interval: nil, poll_interval_milliseconds: nil, identifier: nil, supplemental_settings: nil, **arguments)
|
176
178
|
instance = new(category)
|
177
179
|
|
178
|
-
|
180
|
+
if not identifier.nil?
|
179
181
|
instance.identifier = identifier
|
180
182
|
end
|
181
183
|
|
184
|
+
if not supplemental_settings.nil?
|
185
|
+
if not supplemental_settings.is_a?(::Settings)
|
186
|
+
supplemental_settings = ::Settings.build(supplemental_settings)
|
187
|
+
end
|
188
|
+
|
189
|
+
instance.supplemental_settings = supplemental_settings
|
190
|
+
end
|
191
|
+
|
182
192
|
instance.position_update_interval = position_update_interval
|
183
193
|
instance.poll_interval_milliseconds = poll_interval_milliseconds
|
184
194
|
|
data/lib/consumer/controls.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'settings/controls'
|
1
2
|
require 'messaging/controls'
|
2
3
|
|
3
4
|
require 'consumer/controls/category'
|
@@ -11,7 +12,7 @@ require 'consumer/controls/id'
|
|
11
12
|
require 'consumer/controls/identifier'
|
12
13
|
require 'consumer/controls/position'
|
13
14
|
require 'consumer/controls/session'
|
14
|
-
require 'consumer/controls/
|
15
|
+
require 'consumer/controls/settings'
|
15
16
|
|
16
17
|
require 'consumer/controls/position_store'
|
17
18
|
require 'consumer/controls/position_store/file'
|
@@ -19,6 +20,7 @@ require 'consumer/controls/subscription'
|
|
19
20
|
|
20
21
|
require 'consumer/controls/handle'
|
21
22
|
require 'consumer/controls/handle/raise_error'
|
23
|
+
require 'consumer/controls/handle/settings'
|
22
24
|
|
23
25
|
require 'consumer/controls/actor'
|
24
26
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Consumer
|
2
|
+
module Controls
|
3
|
+
module Handle
|
4
|
+
module Settings
|
5
|
+
Error = Class.new(RuntimeError)
|
6
|
+
|
7
|
+
class Example
|
8
|
+
include Messaging::Handle
|
9
|
+
|
10
|
+
include ::Settings::Setting
|
11
|
+
setting :some_setting
|
12
|
+
|
13
|
+
attr_accessor :some_other_setting
|
14
|
+
|
15
|
+
def configure(settings:)
|
16
|
+
settings.set(self)
|
17
|
+
end
|
18
|
+
|
19
|
+
def handle(message_data)
|
20
|
+
raise Settings::Error if some_setting.nil?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,24 +1,35 @@
|
|
1
1
|
module Consumer
|
2
2
|
module Controls
|
3
3
|
module PositionStore
|
4
|
-
def self.example
|
5
|
-
|
4
|
+
def self.example(&block)
|
5
|
+
if block.nil?
|
6
|
+
cls = Example
|
7
|
+
else
|
8
|
+
cls = example_class(&block)
|
9
|
+
end
|
10
|
+
|
11
|
+
cls.build
|
6
12
|
end
|
7
13
|
|
8
|
-
|
9
|
-
|
14
|
+
def self.example_class(&block)
|
15
|
+
Class.new do
|
16
|
+
include ::Consumer::PositionStore
|
10
17
|
|
11
|
-
|
18
|
+
def self.build
|
19
|
+
instance = new
|
20
|
+
instance.configure
|
21
|
+
instance
|
22
|
+
end
|
12
23
|
|
13
|
-
|
14
|
-
|
15
|
-
end
|
24
|
+
def configure
|
25
|
+
end
|
16
26
|
|
17
|
-
|
18
|
-
instance = new
|
19
|
-
instance.configure
|
20
|
-
instance
|
27
|
+
class_exec(&block) unless block.nil?
|
21
28
|
end
|
29
|
+
end
|
30
|
+
|
31
|
+
Example = example_class do
|
32
|
+
attr_accessor :telemetry_sink
|
22
33
|
|
23
34
|
def configure
|
24
35
|
self.telemetry_sink = ::Consumer::PositionStore::Telemetry::Sink.new
|
@@ -33,6 +44,12 @@ module Consumer
|
|
33
44
|
def put(_)
|
34
45
|
end
|
35
46
|
end
|
47
|
+
|
48
|
+
module Location
|
49
|
+
def self.example
|
50
|
+
'somePositionStream'
|
51
|
+
end
|
52
|
+
end
|
36
53
|
end
|
37
54
|
end
|
38
55
|
end
|
@@ -3,6 +3,7 @@ module Consumer
|
|
3
3
|
def self.included(cls)
|
4
4
|
cls.class_exec do
|
5
5
|
include Dependency
|
6
|
+
include Virtual
|
6
7
|
include Log::Dependency
|
7
8
|
|
8
9
|
extend Build
|
@@ -13,6 +14,8 @@ module Consumer
|
|
13
14
|
prepend Put
|
14
15
|
|
15
16
|
dependency :telemetry, ::Telemetry
|
17
|
+
|
18
|
+
virtual :location
|
16
19
|
end
|
17
20
|
end
|
18
21
|
|
@@ -53,7 +53,7 @@ module Consumer
|
|
53
53
|
end
|
54
54
|
|
55
55
|
if batch.nil? || batch.empty?
|
56
|
-
logger.debug { "Did not resupply; no events available (
|
56
|
+
logger.debug { "Did not resupply; no events available (Stream: #{get.stream_name}, Position: #{position})" }
|
57
57
|
|
58
58
|
:resupply
|
59
59
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-consumer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ntl-actor
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/consumer/controls/get/incrementing.rb
|
115
115
|
- lib/consumer/controls/handle.rb
|
116
116
|
- lib/consumer/controls/handle/raise_error.rb
|
117
|
+
- lib/consumer/controls/handle/settings.rb
|
117
118
|
- lib/consumer/controls/id.rb
|
118
119
|
- lib/consumer/controls/identifier.rb
|
119
120
|
- lib/consumer/controls/message_data.rb
|
@@ -123,7 +124,7 @@ files:
|
|
123
124
|
- lib/consumer/controls/position_store.rb
|
124
125
|
- lib/consumer/controls/position_store/file.rb
|
125
126
|
- lib/consumer/controls/session.rb
|
126
|
-
- lib/consumer/controls/
|
127
|
+
- lib/consumer/controls/settings.rb
|
127
128
|
- lib/consumer/controls/subscription.rb
|
128
129
|
- lib/consumer/defaults.rb
|
129
130
|
- lib/consumer/handler_registry.rb
|
@@ -132,8 +133,6 @@ files:
|
|
132
133
|
- lib/consumer/position_store.rb
|
133
134
|
- lib/consumer/position_store/substitute.rb
|
134
135
|
- lib/consumer/position_store/telemetry.rb
|
135
|
-
- lib/consumer/postgres
|
136
|
-
- lib/consumer/postgres.rb
|
137
136
|
- lib/consumer/subscription.rb
|
138
137
|
- lib/consumer/subscription/defaults.rb
|
139
138
|
- lib/consumer/subscription/get_batch.rb
|
@@ -142,7 +141,7 @@ homepage: https://github.com/eventide-project/consumer
|
|
142
141
|
licenses:
|
143
142
|
- MIT
|
144
143
|
metadata: {}
|
145
|
-
post_install_message:
|
144
|
+
post_install_message:
|
146
145
|
rdoc_options: []
|
147
146
|
require_paths:
|
148
147
|
- lib
|
@@ -157,8 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
156
|
- !ruby/object:Gem::Version
|
158
157
|
version: '0'
|
159
158
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
161
|
-
signing_key:
|
159
|
+
rubygems_version: 3.2.15
|
160
|
+
signing_key:
|
162
161
|
specification_version: 4
|
163
162
|
summary: Continuous subscription to a category and message dispatching to handlers
|
164
163
|
test_files: []
|
data/lib/consumer/postgres
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
lib/consumer/Users/sbellware/projects/eventide/consumer-postgres/lib/consumer/postgres
|
data/lib/consumer/postgres.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
lib/consumer/Users/sbellware/projects/eventide/consumer-postgres/lib/consumer/postgres.rb
|