splitclient-rb 7.3.3.pre.rc9 → 7.3.3.pre.rc10

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
  SHA256:
3
- metadata.gz: ec6fc8163dee8d303228ac119e0d704bd827b00c2a4dd6408cef7af1c7f35767
4
- data.tar.gz: 841be300c51ec06e5abc3b916ab69efeb42bfb15efc36179673dcefce7fd2165
3
+ metadata.gz: 26ed225fcda5a6c69eb42dd34caec716320192c5dde6b53f38b8e8ee0e0006cf
4
+ data.tar.gz: b206d8c015265fdc3fa07f12100b9edbdaece2ff37c6af3520c51a166c52a324
5
5
  SHA512:
6
- metadata.gz: 2fa16a7e50e717f9f0af64d8159a586ca9ece0dcba1c4f56914f73064a07c2fe30edc70ce9460fab3e5cd9282885179a4a4479dcbc613e569c926e9c31d09b57
7
- data.tar.gz: b6e45d41dc353aeca5cb98f666814d57d9481cb8844fdd7170647dead43071a8fbe76d30a7ee45aceb8f4dd43c317bb5806dd20a4e538d64e7e888c0f50c0a81
6
+ metadata.gz: e8d470474c3996b57c2e3c4e5752d636a93fba3200fdb6ea6a88e233ae2a4a8631c1eb113a0052a9e4f6c48be9a4863f7e37e3af89b3e900b85bc55b18942fe6
7
+ data.tar.gz: 2091bdddd0bdbe6a0221a45ebd9e6559f541073bb697b34b3a6443244ede79e78bca487e21900fa23eaacb95e8a114c3caea9c5125faa14b80f0765cdb33ab97
@@ -8,8 +8,9 @@ module SplitIoClient
8
8
 
9
9
  unless thread.nil?
10
10
  config.logger.debug("Stopping #{thread_sym} thread...") if config.debug_enabled
11
- sleep(0.1) while thread.status == 'run'
12
- Thread.kill(thread)
11
+ config.logger.debug("################## #{thread.status}") if config.debug_enabled
12
+ Thread.kill thread
13
+ config.logger.debug("#{thread_sym} killed.") if config.debug_enabled
13
14
  end
14
15
  rescue StandardError => e
15
16
  config.logger.error(e.inspect)
@@ -37,7 +37,6 @@ module SplitIoClient
37
37
 
38
38
  def close(action = Constants::PUSH_NONRETRYABLE_ERROR)
39
39
  @connected.make_false
40
- SplitIoClient::Helpers::ThreadHelper.stop(:connect_stream, @config)
41
40
  @socket&.close
42
41
  dispatch_action(action)
43
42
  rescue StandardError => e
@@ -72,12 +71,14 @@ module SplitIoClient
72
71
  def connect_thread(latch)
73
72
  @config.threads[:connect_stream] = Thread.new do
74
73
  @config.logger.info('Starting connect_stream thread ...') if @config.debug_enabled
75
- connect_stream(latch)
74
+ closed_with_exception = connect_stream(latch)
75
+ close(closed_with_exception) unless closed_with_exception.nil?
76
+ @config.logger.info('connect_stream thread finished.') if @config.debug_enabled
76
77
  end
77
78
  end
78
79
 
79
80
  def connect_stream(latch)
80
- socket_write(latch)
81
+ return Constants::PUSH_NONRETRYABLE_ERROR unless socket_write(latch)
81
82
 
82
83
  while connected? || @first_event.value
83
84
  begin
@@ -88,22 +89,23 @@ module SplitIoClient
88
89
  raise 'eof exception' if partial_data == :eof
89
90
  rescue StandardError => e
90
91
  @config.logger.error('Error reading partial data: ' + e.inspect) if @config.debug_enabled
91
- close(Constants::PUSH_RETRYABLE_ERROR)
92
- return
92
+ return Constants::PUSH_RETRYABLE_ERROR
93
93
  end
94
94
 
95
95
  process_data(partial_data)
96
96
  end
97
+ nil
97
98
  end
98
99
 
99
100
  def socket_write(latch)
100
101
  @first_event.make_true
101
102
  @socket = socket_connect
102
103
  @socket.write(build_request(@uri))
104
+ true
103
105
  rescue StandardError => e
104
106
  @config.logger.error("Error during connecting to #{@uri.host}. Error: #{e.inspect}")
105
- close(Constants::PUSH_NONRETRYABLE_ERROR)
106
107
  latch.count_down
108
+ false
107
109
  end
108
110
 
109
111
  def read_first_event(data, latch)
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '7.3.3.pre.rc9'
2
+ VERSION = '7.3.3.pre.rc10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.3.pre.rc9
4
+ version: 7.3.3.pre.rc10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software