splitclient-rb 7.3.3.pre.rc14-java → 7.3.3.pre.rc18-java

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
  SHA1:
3
- metadata.gz: 8648cd9f96feaf87170f931e640405f393922b59
4
- data.tar.gz: 268645f59cde745017905266d920d43b866eebcb
3
+ metadata.gz: 6a79e927377e3dc77ae463d6d49b44d1a53ef13b
4
+ data.tar.gz: fd79e1beb8cf0acc67f94a9a294608e542ccdf92
5
5
  SHA512:
6
- metadata.gz: 998dfcc024601f920d22e722624a993cfc7aa5d5c6c7099a3d62a0fa9a19915913f5f9ce8d198e2fca45f70b1c95aa22a1fc2c776f370c1a4ee2b60e4cd6ca3b
7
- data.tar.gz: 022fe8fc3f3db13ac6e7063ba31db902e81566a21f64a76b9b57a96b06cce58701020495d906b3d0f4ee26814370ec66f2df9307dc7584bb6df2bdaf234ff487
6
+ metadata.gz: ad1731dafeaea84462e468484a21dcb9ec593b6589ee74dc7b8386684212de5b901f233c023a4a1031496bb94cf243695513f98089bb085447913ed1a9d82e7a
7
+ data.tar.gz: fe9bd4198770ccacbf5e44fa80987776e0dfe539aed0396a1b8bf96af450065afdab2ebb619cbaf234b4352e5712a05e9ae90ff472755960502d46641abaf194
@@ -34,13 +34,7 @@ module SplitIoClient
34
34
  end
35
35
 
36
36
  def stop_sse
37
- @config.logger.error('## STOP SSE')
38
- @sse_handler.process_disconnect if @sse_handler.sse_client.nil?
39
37
  @sse_handler.stop
40
- stop_next_token_refresh
41
- end
42
-
43
- def stop_next_token_refresh
44
38
  SplitIoClient::Helpers::ThreadHelper.stop(:schedule_next_token_refresh, @config)
45
39
  end
46
40
 
@@ -52,12 +46,9 @@ module SplitIoClient
52
46
  @config.logger.debug("schedule_next_token_refresh refresh in #{time} seconds.") if @config.debug_enabled
53
47
  sleep(time)
54
48
  @config.logger.debug('schedule_next_token_refresh starting ...') if @config.debug_enabled
55
- @config.logger.error('## SCHEDULE NEXT TOKEN')
56
-
57
49
  @sse_handler.stop
58
50
  start_sse
59
51
  rescue StandardError => e
60
- @config.logger.error("## SCHEDULE EXCEPTION #{e.inspect}")
61
52
  @config.logger.debug("schedule_next_token_refresh error: #{e.inspect}") if @config.debug_enabled
62
53
  end
63
54
  end
@@ -67,7 +67,6 @@ module SplitIoClient
67
67
  end
68
68
 
69
69
  def process_action(action)
70
- @config.logger.error("process_action #{action}")
71
70
  case action
72
71
  when Constants::PUSH_CONNECTED
73
72
  process_connected
@@ -118,8 +117,8 @@ module SplitIoClient
118
117
 
119
118
  @sse_connected.make_true
120
119
  @synchronizer.stop_periodic_fetch
121
- @sse_handler.start_workers
122
120
  @synchronizer.sync_all
121
+ @sse_handler.start_workers
123
122
  record_telemetry(Telemetry::Domain::Constants::SYNC_MODE, SYNC_MODE_STREAMING)
124
123
  rescue StandardError => e
125
124
  @config.logger.error("process_connected error: #{e.inspect}")
@@ -132,8 +131,8 @@ module SplitIoClient
132
131
  end
133
132
 
134
133
  @sse_connected.make_false
135
- @synchronizer.start_periodic_fetch
136
134
  @sse_handler.stop_workers
135
+ @synchronizer.start_periodic_fetch
137
136
  record_telemetry(Telemetry::Domain::Constants::SYNC_MODE, SYNC_MODE_POLLING)
138
137
 
139
138
  if reconnect
@@ -7,8 +7,8 @@ module SplitIoClient
7
7
  thread = config.threads[thread_sym]
8
8
 
9
9
  unless thread.nil?
10
- Thread.kill thread
11
- config.logger.debug("#{thread_sym} killed.") if config.debug_enabled
10
+ config.logger.debug("Stopping #{thread_sym} thread...") if config.debug_enabled
11
+ Thread.kill(thread)
12
12
  end
13
13
  rescue StandardError => e
14
14
  config.logger.error(e.inspect)
@@ -35,7 +35,7 @@ module SplitIoClient
35
35
  @on[:action] = action
36
36
  end
37
37
 
38
- def close
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,7 @@ module SplitIoClient
43
43
 
44
44
  @connected.make_false
45
45
  @socket&.close
46
- @config.logger.error('## CLOSE SSE')
46
+ dispatch_action(action) unless action.nil?
47
47
  rescue StandardError => e
48
48
  @config.logger.error("SSEClient close Error: #{e.inspect}")
49
49
  end
@@ -75,12 +75,10 @@ module SplitIoClient
75
75
 
76
76
  def connect_thread(latch)
77
77
  @config.threads[:connect_stream] = Thread.new do
78
- @config.logger.error('## CONNECT THREAD')
79
78
  @config.logger.info('Starting connect_stream thread ...') if @config.debug_enabled
80
- closed_with_exception = connect_stream(latch)
81
- dispatch_action(closed_with_exception) unless closed_with_exception.nil?
79
+ action = connect_stream(latch)
80
+ dispatch_action(action) unless action.nil?
82
81
  @config.logger.info('connect_stream thread finished.') if @config.debug_enabled
83
- @config.logger.error('#### DISCONNECTED')
84
82
  end
85
83
  end
86
84
 
@@ -98,6 +96,8 @@ module SplitIoClient
98
96
  @config.logger.error(e.inspect)
99
97
  return nil
100
98
  rescue StandardError => e
99
+ return nil if ENV['SPLITCLIENT_ENV'] == 'test'
100
+
101
101
  @config.logger.error("Error reading partial data: #{e.inspect}") if @config.debug_enabled
102
102
  return Constants::PUSH_RETRYABLE_ERROR
103
103
  end
@@ -31,7 +31,7 @@ module SplitIoClient
31
31
  end
32
32
 
33
33
  def stop
34
- @sse_client.close
34
+ @sse_client.close(Constants::PUSH_NONRETRYABLE_ERROR)
35
35
  stop_workers
36
36
  rescue StandardError => e
37
37
  @config.logger.debug("SSEHandler stop error: #{e.inspect}") if @config.debug_enabled
@@ -13,11 +13,6 @@ module SplitIoClient
13
13
  end
14
14
 
15
15
  def add_to_queue(change_number, segment_name)
16
- unless @running.value
17
- @config.logger.debug('segments worker not running.')
18
- return
19
- end
20
-
21
16
  item = { change_number: change_number, segment_name: segment_name }
22
17
  @config.logger.debug("SegmentsWorker add to queue #{item}")
23
18
  @queue.push(item)
@@ -33,21 +33,11 @@ module SplitIoClient
33
33
  end
34
34
 
35
35
  def add_to_queue(change_number)
36
- unless @running.value
37
- @config.logger.debug('splits worker not running.')
38
- return
39
- end
40
-
41
36
  @config.logger.debug("SplitsWorker add to queue #{change_number}")
42
37
  @queue.push(change_number)
43
38
  end
44
39
 
45
40
  def kill_split(change_number, split_name, default_treatment)
46
- unless @running.value
47
- @config.logger.debug('splits worker not running.')
48
- return
49
- end
50
-
51
41
  return if @splits_repository.get_change_number.to_i > change_number
52
42
 
53
43
  @config.logger.debug("SplitsWorker kill #{split_name}, #{change_number}")
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '7.3.3.pre.rc14'
2
+ VERSION = '7.3.3.pre.rc18'
3
3
  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.rc14
4
+ version: 7.3.3.pre.rc18
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-24 00:00:00.000000000 Z
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement