evt-consumer 0.2.0.2 → 0.2.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d8a67363fe73b9f14487853b768ae7c7517a8cf
|
4
|
+
data.tar.gz: 186fe59a8acbbf419b705b88a343fd87e07a84e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49ac045f2b5f46c4d4ced49a8fb7cab179be64efb2bedf80502d4a175d6b6ef3dd2f80bd25f5e51704cbc963c9f2fddbecd61a39f0e4e857c6584e82be5cf78c
|
7
|
+
data.tar.gz: 50fc32c50bf55ea29a308afcc3c15e46239396d151a7717e53ad2d636c99e1ca5b3ef108adfd252f06d4887063ff47e5244353276d7c221e7c58817024e46a84
|
data/lib/consumer/consumer.rb
CHANGED
@@ -4,6 +4,7 @@ module Consumer
|
|
4
4
|
include Log::Dependency
|
5
5
|
|
6
6
|
extend Build
|
7
|
+
extend Run
|
7
8
|
extend Start
|
8
9
|
|
9
10
|
extend HandleMacro
|
@@ -106,15 +107,44 @@ module Consumer
|
|
106
107
|
end
|
107
108
|
end
|
108
109
|
|
110
|
+
module Run
|
111
|
+
def run(stream_name, **arguments, &action)
|
112
|
+
consumer, threads, addresses = nil
|
113
|
+
|
114
|
+
return_value = start stream_name, **arguments do |_consumer, _threads, _addresses|
|
115
|
+
consumer = _consumer
|
116
|
+
threads = _threads
|
117
|
+
addresses = _addresses
|
118
|
+
end
|
119
|
+
|
120
|
+
loop do
|
121
|
+
action.(consumer, threads, addresses) if action
|
122
|
+
consumer.subscription.cycle { nil }
|
123
|
+
end
|
124
|
+
|
125
|
+
addresses.each do |address|
|
126
|
+
Actor::Messaging::Send.(:stop, address)
|
127
|
+
end
|
128
|
+
|
129
|
+
threads.each &:join
|
130
|
+
|
131
|
+
return_value
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
109
135
|
module Start
|
110
136
|
def start(stream_name, **arguments, &probe)
|
111
137
|
instance = build stream_name, **arguments
|
112
138
|
|
113
139
|
_, subscription_thread = ::Actor::Start.(instance.subscription)
|
114
140
|
|
115
|
-
actor_address = Actor.start instance, instance.subscription
|
141
|
+
actor_address, actor_thread = Actor.start instance, instance.subscription, include: :thread
|
142
|
+
|
143
|
+
if probe
|
144
|
+
subscription_address = instance.subscription.address
|
116
145
|
|
117
|
-
|
146
|
+
probe.(instance, [actor_thread, subscription_thread], [actor_address, subscription_address])
|
147
|
+
end
|
118
148
|
|
119
149
|
AsyncInvocation::Incorrect
|
120
150
|
end
|
data/lib/consumer/controls.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Consumer
|
2
2
|
module Controls
|
3
3
|
module Consumer
|
4
|
-
class
|
4
|
+
class LogsEvents
|
5
5
|
include ::Consumer
|
6
6
|
|
7
7
|
def self.logger
|
@@ -18,7 +18,7 @@ module Consumer
|
|
18
18
|
|
19
19
|
position_store PositionStore::LocalFile, update_interval: 10
|
20
20
|
|
21
|
-
def configure(session: nil)
|
21
|
+
def configure(session: nil, batch_size: nil)
|
22
22
|
sleep_duration = ENV['SLEEP_DURATION'] || 100
|
23
23
|
sleep_duration = sleep_duration.to_i
|
24
24
|
|
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: 0.2.0
|
4
|
+
version: 0.2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ntl-actor
|
@@ -78,7 +78,7 @@ files:
|
|
78
78
|
- lib/consumer/controls.rb
|
79
79
|
- lib/consumer/controls/category.rb
|
80
80
|
- lib/consumer/controls/consumer.rb
|
81
|
-
- lib/consumer/controls/consumer/
|
81
|
+
- lib/consumer/controls/consumer/logs_events.rb
|
82
82
|
- lib/consumer/controls/cycle.rb
|
83
83
|
- lib/consumer/controls/error.rb
|
84
84
|
- lib/consumer/controls/event_data.rb
|