evt-consumer 0.2.0.1 → 0.2.0.2
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/lib/consumer/consumer.rb +10 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ec0dc418431484fe90c48904fd9035945a1e3a
|
4
|
+
data.tar.gz: 0ff7f4336263b707f7ad708efe14cfcf77e35703
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c669c8fd9b42a44ad326a414ec1e0910d34f17e6932c1a77335ac6802485e9e5ad16453d74061a08acb4d0a4acd860adad52883d3151771ea6d248644f918e17
|
7
|
+
data.tar.gz: 7e290bcd01c37d908f2ddf5064f27cabb602b15f1424fb8b3b7d3d7d96d7dc44c9639da57d4ac74e42d494613680b4980f6b43239855df03444ae9a82ece78ed
|
data/lib/consumer/consumer.rb
CHANGED
@@ -55,6 +55,10 @@ module Consumer
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
def position_update_interval
|
59
|
+
@position_update_interval ||= self.class.position_update_interval
|
60
|
+
end
|
61
|
+
|
58
62
|
module LogText
|
59
63
|
def self.event_data(event_data)
|
60
64
|
"Stream: #{event_data.stream_name}, Position: #{event_data.position}, GlobalPosition: #{event_data.global_position}, Type: #{event_data.type}"
|
@@ -133,17 +137,17 @@ module Consumer
|
|
133
137
|
def self.extended(cls)
|
134
138
|
cls.singleton_class.class_exec do
|
135
139
|
attr_accessor :position_store_class
|
140
|
+
attr_writer :position_update_interval
|
141
|
+
|
142
|
+
def position_update_interval
|
143
|
+
@position_update_interval ||= Defaults.position_update_interval
|
144
|
+
end
|
136
145
|
end
|
137
146
|
end
|
138
147
|
|
139
148
|
def position_store_macro(position_store_class, update_interval: nil)
|
140
|
-
update_interval ||= Defaults.position_update_interval
|
141
|
-
|
142
149
|
self.position_store_class = position_store_class
|
143
|
-
|
144
|
-
define_method :position_update_interval do
|
145
|
-
@position_update_interval ||= update_interval
|
146
|
-
end
|
150
|
+
self.position_update_interval = update_interval
|
147
151
|
end
|
148
152
|
alias_method :position_store, :position_store_macro
|
149
153
|
end
|