evt-consumer 2.2.0.2 → 2.2.1.0

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: f1655677eabb7b620e0ea1a528d4b3406829041e560d32e803056c7c80926536
4
- data.tar.gz: 7b7c5126c3641c3c042ab3bb6f2ed870c5c5ce078e731cc60b681901097ebe41
3
+ metadata.gz: 7649d0a2b5a09c526df2dfa95cc444d0a0dca2feedd79e760a8911a79c8142e7
4
+ data.tar.gz: 114bc7cc0fa87601299847b87f0d123b830a0449a3ea63b3e124640d5977f12f
5
5
  SHA512:
6
- metadata.gz: 7e9d3b6f759a77e5cb305d61a3f662aed1130e479ba9a14d504f8ed494f2e78e425984996b25518772097c3e830cdffdf355f8b06a89d4444f2e9bb72dae68d0
7
- data.tar.gz: 5121f4eb1a4cc6888e14afbb308b0b907d79013e07fdb5bb3bc314fc49451758c6b38280423efd0bb1be7ce1082b86b49baef7900a06f0187f3b0525e77a7e08
6
+ metadata.gz: a2f6dce7182bb03ec8e1baca18d7bb7184b493b2ef1a94d7132e4ac69a8a81fb28e3f213952bca3ebe973aa7c3a4a2dc2a858362e4faef0df82ef072ff390088
7
+ data.tar.gz: 8d0df31e833932ad736a62e39381d5c1152c40dbd7b4cbb04f01146ceb9b782f62d0d55779be438433fa40eddc186e57ddaeefda0eb9be464a981b6b7aaf4c1e
@@ -87,7 +87,7 @@ module Consumer
87
87
 
88
88
  print_startup_info if respond_to?(:print_startup_info)
89
89
 
90
- STDOUT.puts " Position Stream: #{position_store.stream_name}"
90
+ STDOUT.puts " Position Location: #{position_store.location || '(none)'}"
91
91
 
92
92
  STDOUT.puts
93
93
 
@@ -22,6 +22,10 @@ module Consumer
22
22
  instance
23
23
  end
24
24
 
25
+ def stream_name
26
+ Category.example
27
+ end
28
+
25
29
  def batch_size
26
30
  Defaults.batch_size
27
31
  end
@@ -1,24 +1,35 @@
1
1
  module Consumer
2
2
  module Controls
3
3
  module PositionStore
4
- def self.example
5
- Example.build
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
- class Example
9
- include ::Consumer::PositionStore
14
+ def self.example_class(&block)
15
+ Class.new do
16
+ include ::Consumer::PositionStore
10
17
 
11
- attr_accessor :telemetry_sink
18
+ def self.build
19
+ instance = new
20
+ instance.configure
21
+ instance
22
+ end
12
23
 
13
- def stream_name
14
- 'somePositionStream'
15
- end
24
+ def configure
25
+ end
16
26
 
17
- def self.build
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
 
@@ -1 +1 @@
1
- lib/consumer/Users/sbellware/projects/eventide/consumer-postgres/lib/consumer/postgres
1
+ lib/consumer/home/ntl/Projects/consumer-postgres/lib/consumer/postgres
@@ -1 +1 @@
1
- lib/consumer/Users/sbellware/projects/eventide/consumer-postgres/lib/consumer/postgres.rb
1
+ lib/consumer/home/ntl/Projects/consumer-postgres/lib/consumer/postgres.rb
@@ -46,20 +46,20 @@ module Consumer
46
46
  end
47
47
 
48
48
  handle :resupply do
49
- logger.trace { "Resupplying (Category: #{get.category}, Position: #{position})" }
49
+ logger.trace { "Resupplying (Stream: #{get.stream_name}, Position: #{position})" }
50
50
 
51
51
  batch = poll.() do
52
52
  get.(position)
53
53
  end
54
54
 
55
55
  if batch.nil? || batch.empty?
56
- logger.debug { "Did not resupply; no events available (Category: #{get.category}, Position: #{position})" }
56
+ logger.debug { "Did not resupply; no events available (Stream: #{get.stream_name}, Position: #{position})" }
57
57
 
58
58
  :resupply
59
59
  else
60
60
  self.next_batch = batch
61
61
 
62
- logger.debug { "Resupplied (Category: #{get.category}, Position: #{position}, Batch Size: #{batch.count})" }
62
+ logger.debug { "Resupplied (Stream: #{get.stream_name}, Position: #{position}, Batch Size: #{batch.count})" }
63
63
  end
64
64
  end
65
65
 
@@ -2,6 +2,9 @@ module Consumer
2
2
  class Subscription
3
3
  module Defaults
4
4
  def self.poll_interval_milliseconds
5
+ env_interval = ENV['POLL_INTERVAL_MILLISECONDS']
6
+ return env_interval.to_i if !env_interval.nil?
7
+
5
8
  100
6
9
  end
7
10
 
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.2.0.2
4
+ version: 2.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: 2020-04-17 00:00:00.000000000 Z
11
+ date: 2020-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ntl-actor