splitclient-rb 7.3.3.pre.rc11-java → 7.3.3.pre.rc15-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: d7eed42691d0baf11920f4246d2fb9f91db37765
4
- data.tar.gz: 92b90bb3f3891ecf3848839321cd3562b405a4ff
3
+ metadata.gz: fbe80dcceedb5a8c8314d21e237433db8ab31cf7
4
+ data.tar.gz: dda1b35792fa23504ec78977786ec8c6a4310d0c
5
5
  SHA512:
6
- metadata.gz: ee50e3e24092d150afec5c774c00f425faa4786d59733cfb7a3539ae8c483dbdd5ce49f2d1b56e433169ba7ced2b4f15c614a711bd8adbce8d0ffc36adfca5ee
7
- data.tar.gz: 515315961edd0a16711b531cdb2e1c34e7e310d536ea93e35f150cc078b30a662e789197e7b1317716782f09fad90618c50c7610c1a9c6f25ce9450fec42dbea
6
+ metadata.gz: ac6008e523ce1d692ff49ca33b6a9ccaab0940e539627b2a0fa42b9e1a744599872369fb8f5b8e6d0124d7bdbb7f42c877daf3774d88bd4a731b66c14a3d0f36
7
+ data.tar.gz: 9a581b2b1919fb562c7e2802d0031c35055cf2fbfbf7603812cc5a4a832fe463ba0118b2eb9b09804b9054ede1e1d8f4ffda9884900154fcd4a8e92345f1403f
@@ -34,6 +34,7 @@ module SplitIoClient
34
34
  end
35
35
 
36
36
  def stop_sse
37
+ @config.logger.error('## STOP SSE')
37
38
  @sse_handler.process_disconnect if @sse_handler.sse_client.nil?
38
39
  @sse_handler.stop
39
40
  SplitIoClient::Helpers::ThreadHelper.stop(:schedule_next_token_refresh, @config)
@@ -47,9 +48,12 @@ module SplitIoClient
47
48
  @config.logger.debug("schedule_next_token_refresh refresh in #{time} seconds.") if @config.debug_enabled
48
49
  sleep(time)
49
50
  @config.logger.debug('schedule_next_token_refresh starting ...') if @config.debug_enabled
51
+ @config.logger.error('## SCHEDULE NEXT TOKEN')
52
+
50
53
  @sse_handler.stop
51
54
  start_sse
52
55
  rescue StandardError => e
56
+ @config.logger.error("## SCHEDULE EXCEPTION #{e.inspect}")
53
57
  @config.logger.debug("schedule_next_token_refresh error: #{e.inspect}") if @config.debug_enabled
54
58
  end
55
59
  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
- 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
+ # 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 = Constants::PUSH_NONRETRYABLE_ERROR)
38
+ def close
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
- dispatch_action(action)
46
+ @config.logger.error('## CLOSE SSE')
47
47
  rescue StandardError => e
48
48
  @config.logger.error("SSEClient close Error: #{e.inspect}")
49
49
  end
@@ -75,10 +75,12 @@ 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')
78
79
  @config.logger.info('Starting connect_stream thread ...') if @config.debug_enabled
79
- closed_with_exception = connect_stream(latch)
80
- close(closed_with_exception) unless closed_with_exception.nil?
80
+ action = connect_stream(latch)
81
+ dispatch_action(action)
81
82
  @config.logger.info('connect_stream thread finished.') if @config.debug_enabled
83
+ @config.logger.error('#### DISCONNECTED')
82
84
  end
83
85
  end
84
86
 
@@ -93,8 +95,8 @@ module SplitIoClient
93
95
 
94
96
  raise 'eof exception' if partial_data == :eof
95
97
  rescue Errno::EBADF, IOError => e
96
- @config.logger.debug(e.inspect)
97
- return nil
98
+ @config.logger.error(e.inspect)
99
+ return Constants::PUSH_NONRETRYABLE_ERROR
98
100
  rescue StandardError => e
99
101
  @config.logger.error("Error reading partial data: #{e.inspect}") if @config.debug_enabled
100
102
  return Constants::PUSH_RETRYABLE_ERROR
@@ -102,7 +104,7 @@ module SplitIoClient
102
104
 
103
105
  process_data(partial_data)
104
106
  end
105
- nil
107
+ Constants::PUSH_NONRETRYABLE_ERROR
106
108
  end
107
109
 
108
110
  def socket_write(latch)
@@ -191,8 +193,10 @@ module SplitIoClient
191
193
  end
192
194
 
193
195
  def dispatch_action(action)
194
- @config.logger.debug("Dispatching action: #{action}") if @config.debug_enabled
195
- @on[:action].call(action)
196
+ @config.threads[:dispatch_action] = Thread.new do
197
+ @config.logger.debug("Dispatching action: #{action}") if @config.debug_enabled
198
+ @on[:action].call(action)
199
+ end
196
200
  end
197
201
  end
198
202
  end
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '7.3.3.pre.rc11'
2
+ VERSION = '7.3.3.pre.rc15'
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.rc11
4
+ version: 7.3.3.pre.rc15
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-21 00:00:00.000000000 Z
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