splitclient-rb 7.3.3.pre.rc12-java → 7.3.3.pre.rc16-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/splitclient-rb/engine/push_manager.rb +5 -2
- data/lib/splitclient-rb/engine/sync_manager.rb +2 -0
- data/lib/splitclient-rb/helpers/thread_helper.rb +4 -2
- data/lib/splitclient-rb/sse/event_source/client.rb +11 -8
- data/lib/splitclient-rb/sse/sse_handler.rb +1 -1
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bacbe3dee8e47bd0dd38b5f3428fb79ac6f48990
|
4
|
+
data.tar.gz: 2a108b99a72b99376b44d27b71a3f1da08588091
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7727d3e058742acce12710687e0f01fef50096ad60071faf0443ef3d31e6ae942d30018e7ae2464d5fc89e6a6bd4cc591d4713a32ba6d5deb60f60c99f99ba74
|
7
|
+
data.tar.gz: 79b9bfebc6a073c6bf4b8efe3707d1acb5d214baf976a715fe2f9d815a9aaa334891d24e95a4c7127aaafa0dc57f3f6b296ff1c3a4783ae9e2019fc1153a95ee
|
@@ -18,7 +18,7 @@ module SplitIoClient
|
|
18
18
|
@config.logger.debug("Auth service response push_enabled: #{response[:push_enabled]}") if @config.debug_enabled
|
19
19
|
|
20
20
|
if response[:push_enabled] && @sse_handler.start(response[:token], response[:channels])
|
21
|
-
schedule_next_token_refresh(
|
21
|
+
schedule_next_token_refresh(200)
|
22
22
|
@back_off.reset
|
23
23
|
record_telemetry(response[:exp])
|
24
24
|
|
@@ -34,7 +34,7 @@ module SplitIoClient
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def stop_sse
|
37
|
-
@
|
37
|
+
@config.logger.error('## STOP SSE')
|
38
38
|
@sse_handler.stop
|
39
39
|
SplitIoClient::Helpers::ThreadHelper.stop(:schedule_next_token_refresh, @config)
|
40
40
|
end
|
@@ -47,9 +47,12 @@ module SplitIoClient
|
|
47
47
|
@config.logger.debug("schedule_next_token_refresh refresh in #{time} seconds.") if @config.debug_enabled
|
48
48
|
sleep(time)
|
49
49
|
@config.logger.debug('schedule_next_token_refresh starting ...') if @config.debug_enabled
|
50
|
+
@config.logger.error('## SCHEDULE NEXT TOKEN')
|
51
|
+
|
50
52
|
@sse_handler.stop
|
51
53
|
start_sse
|
52
54
|
rescue StandardError => e
|
55
|
+
@config.logger.error("## SCHEDULE EXCEPTION #{e.inspect}")
|
53
56
|
@config.logger.debug("schedule_next_token_refresh error: #{e.inspect}") if @config.debug_enabled
|
54
57
|
end
|
55
58
|
end
|
@@ -67,6 +67,7 @@ module SplitIoClient
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def process_action(action)
|
70
|
+
@config.logger.error("process_action #{action}")
|
70
71
|
case action
|
71
72
|
when Constants::PUSH_CONNECTED
|
72
73
|
process_connected
|
@@ -136,6 +137,7 @@ module SplitIoClient
|
|
136
137
|
record_telemetry(Telemetry::Domain::Constants::SYNC_MODE, SYNC_MODE_POLLING)
|
137
138
|
|
138
139
|
if reconnect
|
140
|
+
@push_manager.stop_sse
|
139
141
|
@synchronizer.sync_all
|
140
142
|
@push_manager.start_sse
|
141
143
|
end
|
@@ -7,10 +7,12 @@ module SplitIoClient
|
|
7
7
|
thread = config.threads[thread_sym]
|
8
8
|
|
9
9
|
unless thread.nil?
|
10
|
-
|
11
|
-
|
10
|
+
config.logger.debug("Stopping #{thread_sym} thread...") if config.debug_enabled
|
11
|
+
# sleep(0.1) while thread.status == 'run'
|
12
|
+
Thread.kill(thread)
|
12
13
|
end
|
13
14
|
rescue StandardError => e
|
15
|
+
puts e.inspect
|
14
16
|
config.logger.error(e.inspect)
|
15
17
|
end
|
16
18
|
|
@@ -35,7 +35,7 @@ module SplitIoClient
|
|
35
35
|
@on[:action] = action
|
36
36
|
end
|
37
37
|
|
38
|
-
def close(action =
|
38
|
+
def close(action = nil)
|
39
39
|
unless connected?
|
40
40
|
@config.logger.error('SSEClient already disconected.') if @config.debug_enabled
|
41
41
|
return
|
@@ -43,7 +43,8 @@ module SplitIoClient
|
|
43
43
|
|
44
44
|
@connected.make_false
|
45
45
|
@socket&.close
|
46
|
-
|
46
|
+
@config.logger.error('## CLOSE SSE')
|
47
|
+
dispatch_action(action) unless action.nil?
|
47
48
|
rescue StandardError => e
|
48
49
|
@config.logger.error("SSEClient close Error: #{e.inspect}")
|
49
50
|
end
|
@@ -75,12 +76,12 @@ module SplitIoClient
|
|
75
76
|
|
76
77
|
def connect_thread(latch)
|
77
78
|
@config.threads[:connect_stream] = Thread.new do
|
78
|
-
@config.logger.error('
|
79
|
+
@config.logger.error('## CONNECT THREAD')
|
79
80
|
@config.logger.info('Starting connect_stream thread ...') if @config.debug_enabled
|
80
|
-
|
81
|
-
|
81
|
+
action = connect_stream(latch)
|
82
|
+
dispatch_action(action) unless action.nil?
|
82
83
|
@config.logger.info('connect_stream thread finished.') if @config.debug_enabled
|
83
|
-
@config.logger.error('
|
84
|
+
@config.logger.error('#### DISCONNECTED')
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
@@ -193,8 +194,10 @@ module SplitIoClient
|
|
193
194
|
end
|
194
195
|
|
195
196
|
def dispatch_action(action)
|
196
|
-
@config.
|
197
|
-
|
197
|
+
@config.threads[:dispatch_action] = Thread.new do
|
198
|
+
@config.logger.debug("Dispatching action: #{action}") if @config.debug_enabled
|
199
|
+
@on[:action].call(action)
|
200
|
+
end
|
198
201
|
end
|
199
202
|
end
|
200
203
|
end
|
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.3.3.pre.
|
4
|
+
version: 7.3.3.pre.rc16
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|