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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ed225fcda5a6c69eb42dd34caec716320192c5dde6b53f38b8e8ee0e0006cf
|
4
|
+
data.tar.gz: b206d8c015265fdc3fa07f12100b9edbdaece2ff37c6af3520c51a166c52a324
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
12
|
-
Thread.kill
|
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
|
-
|
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)
|