splitclient-rb 7.1.0.pre.rc17-java → 7.1.2-java
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/.rubocop.yml +1 -0
- data/CHANGES.txt +12 -0
- data/lib/splitclient-rb/cache/stores/localhost_split_store.rb +1 -0
- data/lib/splitclient-rb/engine/auth_api_client.rb +7 -5
- data/lib/splitclient-rb/engine/push_manager.rb +0 -1
- data/lib/splitclient-rb/engine/sync_manager.rb +0 -8
- data/lib/splitclient-rb/engine/synchronizer.rb +3 -3
- data/lib/splitclient-rb/split_config.rb +2 -2
- data/lib/splitclient-rb/sse/event_source/client.rb +9 -19
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ac3c5d1a15c4c23e5e16d1632f7b2ae2c7fd331
|
4
|
+
data.tar.gz: 2cc722fd6a9ff744a36fa08c732a550d7c226eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4d41d908e58763fc18f0cc7684f0b2cee93a8e9e4bce83258c69c621c3a52a405fa80deacc3d7a5ed7e6a6a8200da407ff3259f3ae2f1ec13c2a3a81103854c
|
7
|
+
data.tar.gz: 0c4397e97c09b1494216b9dcb84a92a469078fd9472ee4813b11f14ed1d734f8dbccfb50bb4f95007923c435c33cf10ddafb4895714cbcb54e0df0981baae41e
|
data/.rubocop.yml
CHANGED
data/CHANGES.txt
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
CHANGES
|
2
|
+
|
3
|
+
7.1.2 (Jun 15, 2020)
|
4
|
+
- Fixed uninitialized constant LocalhostSplitStore::YAML for console apps.
|
5
|
+
- Updated default_streaming_enabled to true.
|
6
|
+
|
7
|
+
7.1.1 (May 19, 2020)
|
8
|
+
- Updated streaming domain.
|
9
|
+
|
10
|
+
7.1.0 (Apr 30, 2020)
|
11
|
+
- Added support for the new Split streaming architecture. When enabled, the SDK will not poll for updates but instead receive notifications every time there's a change in your environments, allowing to process those much quicker. If disabled (default) or in the event of an issue, the SDK will fallback to the known polling mechanism to provide a seamless experience.
|
12
|
+
|
1
13
|
7.0.3 (Jan 20, 2020)
|
2
14
|
- Added integration tests.
|
3
15
|
- Fixed impressions labels.
|
@@ -17,23 +17,25 @@ module SplitIoClient
|
|
17
17
|
return process_success(response) if response.success?
|
18
18
|
|
19
19
|
if response.status >= 400 && response.status < 500
|
20
|
-
@config.logger.debug("
|
20
|
+
@config.logger.debug("Error connecting to: #{@config.auth_service_url}. Response status: #{response.status}")
|
21
21
|
|
22
22
|
return { push_enabled: false, retry: false }
|
23
23
|
end
|
24
24
|
|
25
|
-
@config.logger.debug("
|
25
|
+
@config.logger.debug("Error connecting to: #{@config.auth_service_url}. Response status: #{response.status}")
|
26
26
|
{ push_enabled: false, retry: true }
|
27
|
+
rescue StandardError => e
|
28
|
+
@config.logger.debug("AuthApiClient error: #{e.inspect}.")
|
29
|
+
{ push_enabled: false, retry: false }
|
27
30
|
end
|
28
31
|
|
29
32
|
private
|
30
33
|
|
31
34
|
def expiration(token_decoded)
|
32
35
|
exp = token_decoded[0]['exp']
|
36
|
+
issued_at = token_decoded[0]['iat']
|
33
37
|
|
34
|
-
|
35
|
-
rescue StandardError => e
|
36
|
-
@config.logger.error("Error getting token expiration: #{e.inspect}")
|
38
|
+
exp - issued_at - SplitIoClient::Constants::EXPIRATION_RATE
|
37
39
|
end
|
38
40
|
|
39
41
|
def channels(token_decoded)
|
@@ -42,7 +42,6 @@ module SplitIoClient
|
|
42
42
|
sleep(time)
|
43
43
|
@config.logger.debug('schedule_next_token_refresh starting ...') if @config.debug_enabled
|
44
44
|
stop_sse
|
45
|
-
sleep(1)
|
46
45
|
start_sse
|
47
46
|
rescue StandardError => e
|
48
47
|
@config.logger.debug("schedule_next_token_refresh error: #{e.inspect}") if @config.debug_enabled
|
@@ -86,14 +86,6 @@ module SplitIoClient
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
def stream_start_thread_forked
|
90
|
-
PhusionPassenger.on_event(:starting_worker_process) { |forked| stream_start_thread if forked }
|
91
|
-
end
|
92
|
-
|
93
|
-
def stream_start_sse_thread_forked
|
94
|
-
PhusionPassenger.on_event(:starting_worker_process) { |forked| stream_start_sse_thread if forked }
|
95
|
-
end
|
96
|
-
|
97
89
|
def start_stream_forked
|
98
90
|
PhusionPassenger.on_event(:starting_worker_process) { |forked| start_stream if forked }
|
99
91
|
end
|
@@ -32,9 +32,9 @@ module SplitIoClient
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def start_periodic_data_recording
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
impressions_sender
|
36
|
+
metrics_sender
|
37
|
+
events_sender
|
38
38
|
end
|
39
39
|
|
40
40
|
def start_periodic_fetch
|
@@ -275,11 +275,11 @@ module SplitIoClient
|
|
275
275
|
end
|
276
276
|
|
277
277
|
def self.default_streaming_service_url
|
278
|
-
'https://
|
278
|
+
'https://streaming.split.io/event-stream'
|
279
279
|
end
|
280
280
|
|
281
281
|
def self.default_auth_service_url
|
282
|
-
'https://auth.split
|
282
|
+
'https://auth.split.io/api/auth'
|
283
283
|
end
|
284
284
|
|
285
285
|
def self.default_auth_retry_back_off_base
|
@@ -65,10 +65,6 @@ module SplitIoClient
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
def connect_passenger_forked
|
69
|
-
PhusionPassenger.on_event(:starting_worker_process) { |forked| connect_thread if forked }
|
70
|
-
end
|
71
|
-
|
72
68
|
def connect_stream
|
73
69
|
interval = @back_off.interval
|
74
70
|
sleep(interval) if interval.positive?
|
@@ -111,9 +107,7 @@ module SplitIoClient
|
|
111
107
|
unless partial_data.nil? || partial_data == KEEP_ALIVE_RESPONSE
|
112
108
|
@config.logger.debug("Event partial data: #{partial_data}") if @config.debug_enabled
|
113
109
|
buffer = read_partial_data(partial_data)
|
114
|
-
|
115
|
-
|
116
|
-
dispatch_event(events)
|
110
|
+
parse_event(buffer)
|
117
111
|
end
|
118
112
|
rescue StandardError => e
|
119
113
|
@config.logger.error("process_data error: #{e.inspect}")
|
@@ -137,7 +131,6 @@ module SplitIoClient
|
|
137
131
|
|
138
132
|
def parse_event(buffer)
|
139
133
|
type = nil
|
140
|
-
events = []
|
141
134
|
|
142
135
|
buffer.each do |d|
|
143
136
|
splited_data = d.split(':')
|
@@ -147,15 +140,14 @@ module SplitIoClient
|
|
147
140
|
type = splited_data[1].strip
|
148
141
|
when 'data'
|
149
142
|
data = parse_event_data(d, type)
|
150
|
-
|
143
|
+
unless type.nil? || data[:data].nil?
|
144
|
+
event = StreamData.new(type, data[:client_id], data[:data], data[:channel])
|
145
|
+
dispatch_event(event)
|
146
|
+
end
|
151
147
|
end
|
152
148
|
end
|
153
|
-
|
154
|
-
events
|
155
149
|
rescue StandardError => e
|
156
|
-
@config.logger.error(buffer)
|
157
150
|
@config.logger.error("Error during parsing a event: #{e.inspect}")
|
158
|
-
[]
|
159
151
|
end
|
160
152
|
|
161
153
|
def parse_event_data(data, type)
|
@@ -168,13 +160,11 @@ module SplitIoClient
|
|
168
160
|
{ client_id: client_id, channel: channel, data: parsed_data }
|
169
161
|
end
|
170
162
|
|
171
|
-
def dispatch_event(
|
172
|
-
|
173
|
-
raise SSEClientException.new(event), 'Error event' if event.event_type == 'error'
|
163
|
+
def dispatch_event(event)
|
164
|
+
raise SSEClientException.new(event), 'Error event' if event.event_type == 'error'
|
174
165
|
|
175
|
-
|
176
|
-
|
177
|
-
end
|
166
|
+
@config.logger.debug("Dispatching event: #{event.event_type}, #{event.channel}") if @config.debug_enabled
|
167
|
+
@on[:event].call(event)
|
178
168
|
rescue SSEClientException => e
|
179
169
|
@config.logger.error("Event error: #{e.event.event_type}, #{e.event.data}")
|
180
170
|
close
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splitclient-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -444,9 +444,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
444
444
|
version: '0'
|
445
445
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
446
446
|
requirements:
|
447
|
-
- - "
|
447
|
+
- - ">="
|
448
448
|
- !ruby/object:Gem::Version
|
449
|
-
version:
|
449
|
+
version: '0'
|
450
450
|
requirements: []
|
451
451
|
rubyforge_project:
|
452
452
|
rubygems_version: 2.6.14
|