splitclient-rb 6.4.1.pre.rc3-java → 7.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.txt +15 -1
- data/Detailed-README.md +9 -21
- data/NEWS +3 -0
- data/lib/splitclient-rb.rb +2 -1
- data/lib/splitclient-rb/cache/adapters/cache_adapter.rb +3 -3
- data/lib/splitclient-rb/cache/repositories/events/memory_repository.rb +5 -4
- data/lib/splitclient-rb/cache/repositories/events/redis_repository.rb +4 -3
- data/lib/splitclient-rb/cache/repositories/events_repository.rb +10 -9
- data/lib/splitclient-rb/cache/repositories/impressions/memory_repository.rb +7 -6
- data/lib/splitclient-rb/cache/repositories/impressions/redis_repository.rb +5 -4
- data/lib/splitclient-rb/cache/repositories/impressions_repository.rb +9 -8
- data/lib/splitclient-rb/cache/repositories/metrics/memory_repository.rb +3 -2
- data/lib/splitclient-rb/cache/repositories/metrics/redis_repository.rb +5 -4
- data/lib/splitclient-rb/cache/repositories/metrics_repository.rb +6 -4
- data/lib/splitclient-rb/cache/repositories/repository.rb +7 -2
- data/lib/splitclient-rb/cache/repositories/segments_repository.rb +6 -5
- data/lib/splitclient-rb/cache/repositories/splits_repository.rb +56 -14
- data/lib/splitclient-rb/cache/routers/impression_router.rb +5 -4
- data/lib/splitclient-rb/cache/senders/events_sender.rb +7 -6
- data/lib/splitclient-rb/cache/senders/impressions_sender.rb +10 -9
- data/lib/splitclient-rb/cache/senders/metrics_sender.rb +9 -8
- data/lib/splitclient-rb/cache/stores/sdk_blocker.rb +19 -10
- data/lib/splitclient-rb/cache/stores/segment_store.rb +15 -28
- data/lib/splitclient-rb/cache/stores/split_store.rb +13 -15
- data/lib/splitclient-rb/clients/localhost_split_client.rb +8 -7
- data/lib/splitclient-rb/clients/split_client.rb +65 -35
- data/lib/splitclient-rb/engine/api/client.rb +17 -13
- data/lib/splitclient-rb/engine/api/events.rb +7 -6
- data/lib/splitclient-rb/engine/api/impressions.rb +6 -5
- data/lib/splitclient-rb/engine/api/metrics.rb +8 -7
- data/lib/splitclient-rb/engine/api/segments.rb +11 -10
- data/lib/splitclient-rb/engine/api/splits.rb +6 -5
- data/lib/splitclient-rb/engine/matchers/all_keys_matcher.rb +1 -1
- data/lib/splitclient-rb/engine/matchers/between_matcher.rb +7 -5
- data/lib/splitclient-rb/engine/matchers/combining_matcher.rb +5 -4
- data/lib/splitclient-rb/engine/matchers/contains_all_matcher.rb +4 -4
- data/lib/splitclient-rb/engine/matchers/contains_any_matcher.rb +3 -3
- data/lib/splitclient-rb/engine/matchers/contains_matcher.rb +7 -5
- data/lib/splitclient-rb/engine/matchers/dependency_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/ends_with_matcher.rb +5 -4
- data/lib/splitclient-rb/engine/matchers/equal_to_boolean_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/equal_to_matcher.rb +6 -4
- data/lib/splitclient-rb/engine/matchers/equal_to_set_matcher.rb +3 -3
- data/lib/splitclient-rb/engine/matchers/greater_than_or_equal_to_matcher.rb +6 -4
- data/lib/splitclient-rb/engine/matchers/less_than_or_equal_to_matcher.rb +6 -4
- data/lib/splitclient-rb/engine/matchers/matcher.rb +4 -0
- data/lib/splitclient-rb/engine/matchers/matches_string_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/negation_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb +4 -4
- data/lib/splitclient-rb/engine/matchers/set_matcher.rb +2 -1
- data/lib/splitclient-rb/engine/matchers/starts_with_matcher.rb +4 -3
- data/lib/splitclient-rb/engine/matchers/user_defined_segment_matcher.rb +3 -2
- data/lib/splitclient-rb/engine/matchers/whitelist_matcher.rb +7 -5
- data/lib/splitclient-rb/engine/models/label.rb +2 -0
- data/lib/splitclient-rb/engine/parser/condition.rb +31 -20
- data/lib/splitclient-rb/engine/parser/evaluator.rb +3 -2
- data/lib/splitclient-rb/engine/parser/split_adapter.rb +9 -7
- data/lib/splitclient-rb/localhost_split_factory.rb +3 -2
- data/lib/splitclient-rb/managers/split_manager.rb +39 -5
- data/lib/splitclient-rb/redis_metrics_fixer.rb +5 -4
- data/lib/splitclient-rb/split_config.rb +35 -14
- data/lib/splitclient-rb/split_factory.rb +44 -32
- data/lib/splitclient-rb/split_factory_builder.rb +4 -5
- data/lib/splitclient-rb/split_factory_registry.rb +51 -0
- data/lib/splitclient-rb/split_logger.rb +5 -14
- data/lib/splitclient-rb/validators.rb +19 -16
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +5 -4
@@ -6,9 +6,10 @@ module SplitIoClient
|
|
6
6
|
|
7
7
|
attr_reader :attribute
|
8
8
|
|
9
|
-
def initialize(attribute, regexp_string)
|
9
|
+
def initialize(attribute, regexp_string, logger)
|
10
10
|
@attribute = attribute
|
11
11
|
@regexp_string = @regexp_string.is_a?(Regexp) ? regexp_string : Regexp.new(regexp_string)
|
12
|
+
@logger = logger
|
12
13
|
end
|
13
14
|
|
14
15
|
def match?(args)
|
@@ -17,7 +18,7 @@ module SplitIoClient
|
|
17
18
|
end
|
18
19
|
|
19
20
|
matches = !(value =~ @regexp_string).nil?
|
20
|
-
|
21
|
+
@logger.log_if_debug("[MatchesStringMatcher] #{value} matches #{@regexp_string} -> #{matches}")
|
21
22
|
matches
|
22
23
|
end
|
23
24
|
|
@@ -7,7 +7,8 @@ module SplitIoClient
|
|
7
7
|
class NegationMatcher < Matcher
|
8
8
|
MATCHER_TYPE = 'NEGATION_MATCHER'
|
9
9
|
|
10
|
-
def initialize(matcher = nil)
|
10
|
+
def initialize(logger, matcher = nil)
|
11
|
+
super(logger)
|
11
12
|
@matcher = matcher
|
12
13
|
end
|
13
14
|
|
@@ -19,7 +20,7 @@ module SplitIoClient
|
|
19
20
|
# @return [boolean] evaluation of the negation matcher
|
20
21
|
def match?(args)
|
21
22
|
matches = !@matcher.match?(args)
|
22
|
-
|
23
|
+
@logger.log_if_debug("[NegationMatcherMatcher] Matcher #{@matcher} Arguments #{args} -> #{matches}")
|
23
24
|
matches
|
24
25
|
end
|
25
26
|
|
@@ -6,20 +6,20 @@ module SplitIoClient
|
|
6
6
|
|
7
7
|
attr_reader :attribute
|
8
8
|
|
9
|
-
def initialize(attribute, remote_array)
|
10
|
-
super(attribute, remote_array)
|
9
|
+
def initialize(attribute, remote_array, logger)
|
10
|
+
super(attribute, remote_array, logger)
|
11
11
|
end
|
12
12
|
|
13
13
|
def match?(args)
|
14
14
|
@local_set = local_set(args[:attributes], @attribute)
|
15
15
|
|
16
16
|
if @local_set.empty?
|
17
|
-
|
17
|
+
@logger.log_if_debug('[PartOfSetMatcher] Local Set is empty.')
|
18
18
|
return false
|
19
19
|
end
|
20
20
|
|
21
21
|
matches = @local_set.subset? @remote_set
|
22
|
-
|
22
|
+
@logger.log_if_debug("[PartOfSetMatcher] Local Set #{@local_set} is a subset of #{@remote_set} -> #{matches}")
|
23
23
|
matches
|
24
24
|
end
|
25
25
|
end
|
@@ -10,9 +10,10 @@ module SplitIoClient
|
|
10
10
|
|
11
11
|
protected
|
12
12
|
|
13
|
-
def initialize(attribute, remote_array)
|
13
|
+
def initialize(attribute, remote_array, logger)
|
14
14
|
@attribute = attribute
|
15
15
|
@remote_set = remote_array.to_set
|
16
|
+
@logger = logger
|
16
17
|
end
|
17
18
|
|
18
19
|
def local_set(data, attribute)
|
@@ -6,21 +6,22 @@ module SplitIoClient
|
|
6
6
|
|
7
7
|
attr_reader :attribute
|
8
8
|
|
9
|
-
def initialize(attribute, prefix_list)
|
9
|
+
def initialize(attribute, prefix_list, logger)
|
10
10
|
@attribute = attribute
|
11
11
|
@prefix_list = prefix_list
|
12
|
+
@logger = logger
|
12
13
|
end
|
13
14
|
|
14
15
|
def match?(args)
|
15
16
|
if @prefix_list.empty?
|
16
|
-
|
17
|
+
@logger.log_if_debug('[StartsWithMatcher] Prefix List is empty.')
|
17
18
|
return false
|
18
19
|
end
|
19
20
|
|
20
21
|
value = get_value(args)
|
21
22
|
|
22
23
|
matches = @prefix_list.any? { |prefix| value.to_s.start_with? prefix }
|
23
|
-
|
24
|
+
@logger.log_if_debug("[StartsWithMatcher] #{value} matches any of #{@prefix_list} -> #{matches}")
|
24
25
|
matches
|
25
26
|
end
|
26
27
|
|
@@ -7,7 +7,8 @@ module SplitIoClient
|
|
7
7
|
class UserDefinedSegmentMatcher < Matcher
|
8
8
|
MATCHER_TYPE = 'IN_SEGMENT'
|
9
9
|
|
10
|
-
def initialize(segments_repository, segment_name)
|
10
|
+
def initialize(segments_repository, segment_name, logger)
|
11
|
+
super(logger)
|
11
12
|
@segments_repository = segments_repository
|
12
13
|
@segment_name = segment_name
|
13
14
|
end
|
@@ -20,7 +21,7 @@ module SplitIoClient
|
|
20
21
|
# @return [boolean] evaluation of the key against the segment
|
21
22
|
def match?(args)
|
22
23
|
matches = @segments_repository.in_segment?(@segment_name, args[:value] || args[:matching_key])
|
23
|
-
|
24
|
+
@logger.log_if_debug("[InSegmentMatcher] #{@segment_name} is in segment -> #{matches}")
|
24
25
|
matches
|
25
26
|
end
|
26
27
|
end
|
@@ -9,7 +9,9 @@ module SplitIoClient
|
|
9
9
|
|
10
10
|
attr_reader :attribute
|
11
11
|
|
12
|
-
def initialize(whitelist_data)
|
12
|
+
def initialize(whitelist_data, logger, validator)
|
13
|
+
super(logger)
|
14
|
+
@validator = validator
|
13
15
|
@whitelist = case whitelist_data
|
14
16
|
when Array
|
15
17
|
whitelist_data
|
@@ -26,9 +28,9 @@ module SplitIoClient
|
|
26
28
|
def match?(args)
|
27
29
|
return matches_user_whitelist(args) unless @matcher_type == 'ATTR_WHITELIST'
|
28
30
|
|
29
|
-
|
31
|
+
@logger.log_if_debug('[WhitelistMatcher] evaluating value and attributes.')
|
30
32
|
|
31
|
-
return false unless
|
33
|
+
return false unless @validator.valid_matcher_arguments(args)
|
32
34
|
|
33
35
|
matches_attr_whitelist(args)
|
34
36
|
end
|
@@ -49,14 +51,14 @@ module SplitIoClient
|
|
49
51
|
|
50
52
|
def matches_user_whitelist(args)
|
51
53
|
matches = @whitelist.include?(args[:value] || args[:matching_key])
|
52
|
-
|
54
|
+
@logger.log_if_debug("[WhitelistMatcher] #{@whitelist} include \
|
53
55
|
#{args[:value] || args[:matching_key]} -> #{matches}")
|
54
56
|
matches
|
55
57
|
end
|
56
58
|
|
57
59
|
def matches_attr_whitelist(args)
|
58
60
|
matches = @whitelist.include?(args[:value] || args[:attributes][@attribute.to_sym])
|
59
|
-
|
61
|
+
@logger.log_if_debug("[WhitelistMatcher] #{@whitelist} include \
|
60
62
|
#{args[:value] || args[:attributes][@attribute.to_sym]} -> #{matches}")
|
61
63
|
matches
|
62
64
|
end
|
@@ -11,13 +11,14 @@ module SplitIoClient
|
|
11
11
|
# @returns [object] condition values
|
12
12
|
attr_accessor :data
|
13
13
|
|
14
|
-
def initialize(condition)
|
14
|
+
def initialize(condition, config)
|
15
15
|
@data = condition
|
16
16
|
@partitions = set_partitions
|
17
|
+
@config = config
|
17
18
|
end
|
18
19
|
|
19
20
|
def create_condition_matcher(matchers)
|
20
|
-
CombiningMatcher.new(combiner, matchers) if combiner
|
21
|
+
CombiningMatcher.new(@config.split_logger, combiner, matchers) if combiner
|
21
22
|
end
|
22
23
|
|
23
24
|
#
|
@@ -45,11 +46,11 @@ module SplitIoClient
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def negation_matcher(matcher)
|
48
|
-
NegationMatcher.new(matcher)
|
49
|
+
NegationMatcher.new(@config.split_logger, matcher)
|
49
50
|
end
|
50
51
|
|
51
52
|
def matcher_all_keys(_params)
|
52
|
-
@matcher_all_keys ||= AllKeysMatcher.new
|
53
|
+
@matcher_all_keys ||= AllKeysMatcher.new(@config.split_logger)
|
53
54
|
end
|
54
55
|
|
55
56
|
# returns UserDefinedSegmentMatcher[object]
|
@@ -57,7 +58,7 @@ module SplitIoClient
|
|
57
58
|
matcher = params[:matcher]
|
58
59
|
segment_name = matcher[:userDefinedSegmentMatcherData] && matcher[:userDefinedSegmentMatcherData][:segmentName]
|
59
60
|
|
60
|
-
UserDefinedSegmentMatcher.new(params[:segments_repository], segment_name)
|
61
|
+
UserDefinedSegmentMatcher.new(params[:segments_repository], segment_name, @config.split_logger)
|
61
62
|
end
|
62
63
|
|
63
64
|
# returns WhitelistMatcher[object] the whitelist for this condition in case it has a whitelist matcher
|
@@ -72,7 +73,7 @@ module SplitIoClient
|
|
72
73
|
white_list = (matcher[:whitelistMatcherData])[:whitelist]
|
73
74
|
result = { attribute: attribute, value: white_list }
|
74
75
|
end
|
75
|
-
WhitelistMatcher.new(result)
|
76
|
+
WhitelistMatcher.new(result, @config.split_logger, @config.split_validator)
|
76
77
|
end
|
77
78
|
|
78
79
|
def matcher_equal_to(params)
|
@@ -80,7 +81,7 @@ module SplitIoClient
|
|
80
81
|
attribute = (matcher[:keySelector])[:attribute]
|
81
82
|
value = (matcher[:unaryNumericMatcherData])[:value]
|
82
83
|
data_type = (matcher[:unaryNumericMatcherData])[:dataType]
|
83
|
-
EqualToMatcher.new(attribute: attribute, value: value, data_type: data_type)
|
84
|
+
EqualToMatcher.new({attribute: attribute, value: value, data_type: data_type}, @config.split_logger, @config.split_validator)
|
84
85
|
end
|
85
86
|
|
86
87
|
def matcher_greater_than_or_equal_to(params)
|
@@ -88,7 +89,7 @@ module SplitIoClient
|
|
88
89
|
attribute = (matcher[:keySelector])[:attribute]
|
89
90
|
value = (matcher[:unaryNumericMatcherData])[:value]
|
90
91
|
data_type = (matcher[:unaryNumericMatcherData])[:dataType]
|
91
|
-
GreaterThanOrEqualToMatcher.new(attribute: attribute, value: value, data_type: data_type)
|
92
|
+
GreaterThanOrEqualToMatcher.new({attribute: attribute, value: value, data_type: data_type}, @config.split_logger, @config.split_validator)
|
92
93
|
end
|
93
94
|
|
94
95
|
def matcher_less_than_or_equal_to(params)
|
@@ -96,7 +97,7 @@ module SplitIoClient
|
|
96
97
|
attribute = (matcher[:keySelector])[:attribute]
|
97
98
|
value = (matcher[:unaryNumericMatcherData])[:value]
|
98
99
|
data_type = (matcher[:unaryNumericMatcherData])[:dataType]
|
99
|
-
LessThanOrEqualToMatcher.new(attribute: attribute, value: value, data_type: data_type)
|
100
|
+
LessThanOrEqualToMatcher.new({attribute: attribute, value: value, data_type: data_type}, @config.split_logger, @config.split_validator)
|
100
101
|
end
|
101
102
|
|
102
103
|
def matcher_between(params)
|
@@ -105,76 +106,86 @@ module SplitIoClient
|
|
105
106
|
start_value = (matcher[:betweenMatcherData])[:start]
|
106
107
|
end_value = (matcher[:betweenMatcherData])[:end]
|
107
108
|
data_type = (matcher[:betweenMatcherData])[:dataType]
|
108
|
-
BetweenMatcher.new(attribute: attribute, start_value: start_value, end_value: end_value, data_type: data_type)
|
109
|
+
BetweenMatcher.new({attribute: attribute, start_value: start_value, end_value: end_value, data_type: data_type}, @config.split_logger, @config.split_validator)
|
109
110
|
end
|
110
111
|
|
111
112
|
def matcher_equal_to_set(params)
|
112
113
|
EqualToSetMatcher.new(
|
113
114
|
params[:matcher][:keySelector][:attribute],
|
114
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
115
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
116
|
+
@config.split_logger
|
115
117
|
)
|
116
118
|
end
|
117
119
|
|
118
120
|
def matcher_contains_any_of_set(params)
|
119
121
|
ContainsAnyMatcher.new(
|
120
122
|
params[:matcher][:keySelector][:attribute],
|
121
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
123
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
124
|
+
@config.split_logger
|
122
125
|
)
|
123
126
|
end
|
124
127
|
|
125
128
|
def matcher_contains_all_of_set(params)
|
126
129
|
ContainsAllMatcher.new(
|
127
130
|
params[:matcher][:keySelector][:attribute],
|
128
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
131
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
132
|
+
@config.split_logger
|
129
133
|
)
|
130
134
|
end
|
131
135
|
|
132
136
|
def matcher_part_of_set(params)
|
133
137
|
PartOfSetMatcher.new(
|
134
138
|
params[:matcher][:keySelector][:attribute],
|
135
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
139
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
140
|
+
@config.split_logger
|
136
141
|
)
|
137
142
|
end
|
138
143
|
|
139
144
|
def matcher_starts_with(params)
|
140
145
|
StartsWithMatcher.new(
|
141
146
|
params[:matcher][:keySelector][:attribute],
|
142
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
147
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
148
|
+
@config.split_logger
|
143
149
|
)
|
144
150
|
end
|
145
151
|
|
146
152
|
def matcher_ends_with(params)
|
147
153
|
EndsWithMatcher.new(
|
148
154
|
params[:matcher][:keySelector][:attribute],
|
149
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
155
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
156
|
+
@config.split_logger
|
150
157
|
)
|
151
158
|
end
|
152
159
|
|
153
160
|
def matcher_contains_string(params)
|
154
161
|
ContainsMatcher.new(
|
155
162
|
params[:matcher][:keySelector][:attribute],
|
156
|
-
params[:matcher][:whitelistMatcherData][:whitelist]
|
163
|
+
params[:matcher][:whitelistMatcherData][:whitelist],
|
164
|
+
@config.split_logger, @config.split_validator
|
157
165
|
)
|
158
166
|
end
|
159
167
|
|
160
168
|
def matcher_in_split_treatment(params)
|
161
169
|
DependencyMatcher.new(
|
162
170
|
params[:matcher][:dependencyMatcherData][:split],
|
163
|
-
params[:matcher][:dependencyMatcherData][:treatments]
|
171
|
+
params[:matcher][:dependencyMatcherData][:treatments],
|
172
|
+
@config.split_logger
|
164
173
|
)
|
165
174
|
end
|
166
175
|
|
167
176
|
def matcher_equal_to_boolean(params)
|
168
177
|
EqualToBooleanMatcher.new(
|
169
178
|
params[:matcher][:keySelector][:attribute],
|
170
|
-
params[:matcher][:booleanMatcherData]
|
179
|
+
params[:matcher][:booleanMatcherData],
|
180
|
+
@config.split_logger
|
171
181
|
)
|
172
182
|
end
|
173
183
|
|
174
184
|
def matcher_matches_string(params)
|
175
185
|
MatchesStringMatcher.new(
|
176
186
|
params[:matcher][:keySelector][:attribute],
|
177
|
-
params[:matcher][:stringMatcherData]
|
187
|
+
params[:matcher][:stringMatcherData],
|
188
|
+
@config.split_logger
|
178
189
|
)
|
179
190
|
end
|
180
191
|
|
@@ -2,10 +2,11 @@ module SplitIoClient
|
|
2
2
|
module Engine
|
3
3
|
module Parser
|
4
4
|
class Evaluator
|
5
|
-
def initialize(segments_repository, splits_repository, multiple = false)
|
5
|
+
def initialize(segments_repository, splits_repository, config, multiple = false)
|
6
6
|
@splits_repository = splits_repository
|
7
7
|
@segments_repository = segments_repository
|
8
8
|
@multiple = multiple
|
9
|
+
@config = config
|
9
10
|
@cache = {}
|
10
11
|
end
|
11
12
|
|
@@ -48,7 +49,7 @@ module SplitIoClient
|
|
48
49
|
splitter = Splitter.new
|
49
50
|
|
50
51
|
split[:conditions].each do |c|
|
51
|
-
condition = SplitIoClient::Condition.new(c)
|
52
|
+
condition = SplitIoClient::Condition.new(c, @config)
|
52
53
|
|
53
54
|
next if condition.empty?
|
54
55
|
|
@@ -31,7 +31,8 @@ module SplitIoClient
|
|
31
31
|
impressions_repository,
|
32
32
|
metrics_repository,
|
33
33
|
events_repository,
|
34
|
-
sdk_blocker
|
34
|
+
sdk_blocker,
|
35
|
+
config
|
35
36
|
)
|
36
37
|
@api_key = api_key
|
37
38
|
@splits_repository = splits_repository
|
@@ -41,8 +42,9 @@ module SplitIoClient
|
|
41
42
|
@events_repository = events_repository
|
42
43
|
@metrics = Metrics.new(100, @metrics_repository)
|
43
44
|
@sdk_blocker = sdk_blocker
|
45
|
+
@config = config
|
44
46
|
|
45
|
-
start_standalone_components if
|
47
|
+
start_standalone_components if @config.standalone?
|
46
48
|
end
|
47
49
|
|
48
50
|
def start_standalone_components
|
@@ -55,27 +57,27 @@ module SplitIoClient
|
|
55
57
|
|
56
58
|
# Starts thread which loops constantly and stores splits in the splits_repository of choice
|
57
59
|
def split_store
|
58
|
-
SplitStore.new(@splits_repository, @api_key, @metrics, @sdk_blocker).call
|
60
|
+
SplitStore.new(@splits_repository, @api_key, @metrics, @config, @sdk_blocker).call
|
59
61
|
end
|
60
62
|
|
61
63
|
# Starts thread which loops constantly and stores segments in the segments_repository of choice
|
62
64
|
def segment_store
|
63
|
-
SegmentStore.new(@segments_repository, @api_key, @metrics, @sdk_blocker).call
|
65
|
+
SegmentStore.new(@segments_repository, @api_key, @metrics, @config, @sdk_blocker).call
|
64
66
|
end
|
65
67
|
|
66
68
|
# Starts thread which loops constantly and sends impressions to the Split API
|
67
69
|
def impressions_sender
|
68
|
-
ImpressionsSender.new(@impressions_repository, @api_key).call
|
70
|
+
ImpressionsSender.new(@impressions_repository, @api_key, @config).call
|
69
71
|
end
|
70
72
|
|
71
73
|
# Starts thread which loops constantly and sends metrics to the Split API
|
72
74
|
def metrics_sender
|
73
|
-
MetricsSender.new(@metrics_repository, @api_key).call
|
75
|
+
MetricsSender.new(@metrics_repository, @api_key, @config).call
|
74
76
|
end
|
75
77
|
|
76
78
|
# Starts thread which loops constantly and sends events to the Split API
|
77
79
|
def events_sender
|
78
|
-
EventsSender.new(@events_repository).call
|
80
|
+
EventsSender.new(@events_repository, @config).call
|
79
81
|
end
|
80
82
|
end
|
81
83
|
end
|
@@ -2,11 +2,12 @@ module SplitIoClient
|
|
2
2
|
class LocalhostSplitFactory
|
3
3
|
attr_reader :client, :manager
|
4
4
|
|
5
|
-
def initialize(splits_file, reload_rate = nil, logger = nil)
|
5
|
+
def initialize(splits_file, config, reload_rate = nil, logger = nil)
|
6
6
|
@splits_file = splits_file
|
7
7
|
@reload_rate = reload_rate
|
8
|
+
@config = config
|
8
9
|
|
9
|
-
@client = LocalhostSplitClient.new(@splits_file, @reload_rate)
|
10
|
+
@client = LocalhostSplitClient.new(@splits_file, @config, @reload_rate)
|
10
11
|
@manager = LocalhostSplitManager.new(@splits_file, @reload_rate)
|
11
12
|
end
|
12
13
|
end
|