splitclient-rb 7.3.3.pre.rc8-java → 7.3.3.pre.rc12-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74e6b031b443f44ab293d0355a716185addbf48b
4
- data.tar.gz: 9542612810667662c7f2dd7c8189a0d4f665603c
3
+ metadata.gz: 9a8f3ad1261ef01e4087b8db07527d34c8d53e26
4
+ data.tar.gz: 4d3459058da480da12ca745831b3d5db695febd6
5
5
  SHA512:
6
- metadata.gz: f3360fd631c0db200f929ad161a3f2e7c166ddcba0e486d384287d6997a3e4fe5169790444328220def32e495c6c60fb0c203827dd48f2138b4ae21ad4d857ee
7
- data.tar.gz: a477906a046eee9bccf09dc43f957fadfd66c83d2fd389ee31f82b43d327b1bd37f18e665939ffa771ce97c7ef74d80f2b2bc7b4beeb74ecb06d032729390cef
6
+ metadata.gz: d2e3e9637b0404cd1c8423c5de5e84028c8933c4de3b5b2b141dc13e4fd66c3aeab71026f815637482a817c3b378c82a82a6a60fe5c94a6d9bc8da95477b0e6e
7
+ data.tar.gz: 714ca68654d29775fd1332ae79fd22648cd4e2040034fe22ed1c1d3dd3632688c54a70fe1d00991334abe6742f1aa59b10deb650ff1be56ae78e2eec542f1a54
@@ -7,9 +7,8 @@ module SplitIoClient
7
7
  thread = config.threads[thread_sym]
8
8
 
9
9
  unless thread.nil?
10
- config.logger.debug("Stopping #{thread_sym} thread...") if config.debug_enabled
11
- sleep(0.1) while thread.status == 'run'
12
- Thread.kill(thread)
10
+ Thread.kill thread
11
+ config.logger.debug("#{thread_sym} killed.") if config.debug_enabled
13
12
  end
14
13
  rescue StandardError => e
15
14
  config.logger.error(e.inspect)
@@ -36,10 +36,14 @@ module SplitIoClient
36
36
  end
37
37
 
38
38
  def close(action = Constants::PUSH_NONRETRYABLE_ERROR)
39
- dispatch_action(action)
39
+ unless connected?
40
+ @config.logger.error('SSEClient already disconected.') if @config.debug_enabled
41
+ return
42
+ end
43
+
40
44
  @connected.make_false
41
- SplitIoClient::Helpers::ThreadHelper.stop(:connect_stream, @config)
42
45
  @socket&.close
46
+ dispatch_action(action)
43
47
  rescue StandardError => e
44
48
  @config.logger.error("SSEClient close Error: #{e.inspect}")
45
49
  end
@@ -71,13 +75,17 @@ module SplitIoClient
71
75
 
72
76
  def connect_thread(latch)
73
77
  @config.threads[:connect_stream] = Thread.new do
78
+ @config.logger.error('# CONNECT THREAD')
74
79
  @config.logger.info('Starting connect_stream thread ...') if @config.debug_enabled
75
- connect_stream(latch)
80
+ closed_with_exception = connect_stream(latch)
81
+ close(closed_with_exception) unless closed_with_exception.nil?
82
+ @config.logger.info('connect_stream thread finished.') if @config.debug_enabled
83
+ @config.logger.error('# DISCONNECTED THREAD')
76
84
  end
77
85
  end
78
86
 
79
87
  def connect_stream(latch)
80
- socket_write(latch)
88
+ return Constants::PUSH_NONRETRYABLE_ERROR unless socket_write(latch)
81
89
 
82
90
  while connected? || @first_event.value
83
91
  begin
@@ -86,24 +94,28 @@ module SplitIoClient
86
94
  read_first_event(partial_data, latch)
87
95
 
88
96
  raise 'eof exception' if partial_data == :eof
97
+ rescue Errno::EBADF, IOError => e
98
+ @config.logger.error(e.inspect)
99
+ return nil
89
100
  rescue StandardError => e
90
- @config.logger.error('Error reading partial data: ' + e.inspect) if @config.debug_enabled
91
- close(Constants::PUSH_RETRYABLE_ERROR)
92
- return
101
+ @config.logger.error("Error reading partial data: #{e.inspect}") if @config.debug_enabled
102
+ return Constants::PUSH_RETRYABLE_ERROR
93
103
  end
94
104
 
95
105
  process_data(partial_data)
96
106
  end
107
+ nil
97
108
  end
98
109
 
99
110
  def socket_write(latch)
100
111
  @first_event.make_true
101
112
  @socket = socket_connect
102
113
  @socket.write(build_request(@uri))
114
+ true
103
115
  rescue StandardError => e
104
116
  @config.logger.error("Error during connecting to #{@uri.host}. Error: #{e.inspect}")
105
- close(Constants::PUSH_NONRETRYABLE_ERROR)
106
117
  latch.count_down
118
+ false
107
119
  end
108
120
 
109
121
  def read_first_event(data, latch)
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '7.3.3.pre.rc8'
2
+ VERSION = '7.3.3.pre.rc12'
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.rc8
4
+ version: 7.3.3.pre.rc12
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-20 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement