splitclient-rb 8.10.0.pre.rc4 → 8.10.0.pre.rc5

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
  SHA256:
3
- metadata.gz: fb3dfc125b557830b44424f5d6a42dbf5ba16f823d7741910020083a3e755b95
4
- data.tar.gz: 940c7952301a2859e3d5f5c77b00587ec81015a2919f893aadd38adb73bad867
3
+ metadata.gz: cd1c96c4c828e35b92aab1832e76f5b3e86b430d1c96063837b44e7149aa1cd8
4
+ data.tar.gz: e35412918b839f46cc7f547f7f1f1ac8f8163ab7d1c47de79a4ed013dc78b5eb
5
5
  SHA512:
6
- metadata.gz: 26170c1a732d710b4894a8c72b4c84a4d056fb6aa960fdfb3c91c9e7171dcd27fdd407808d4bd9684a70c9896487cdec4b9d57b8c8a9d07952eaf0f44934adee
7
- data.tar.gz: 241aae97c4318d37d23284f4fb6cedc05f3991c49e4044048f8051c893177a6b0afecc80da393fa4b7d4e6037f5f09ba60e4a11381ab8d3ad2db2b653450828a
6
+ metadata.gz: 57c47112c8de1cd38bde1bc462d67ce3f5bb63eb41b6c775fe08591c24e991938c89ed4fd1d48f05008c897dd7af7e79da08578e17a9919db2d547c3b746d6d6
7
+ data.tar.gz: 3541514099aef7a845b89eda8924e307916b7b1f32aff5406054907ac7823f2c9014d0352bb9cc7c6e781d84970de9eeb0a5d8a87afade7ecc8ec7aa8586a824
@@ -87,32 +87,39 @@ module SplitIoClient
87
87
  return Constants::PUSH_NONRETRYABLE_ERROR unless socket_write(latch)
88
88
  while connected? || @first_event.value
89
89
  log_if_debug("Inside coonnect_stream while loop.", 3)
90
- begin
91
- partial_data = ""
92
- Timeout::timeout @read_timeout do
90
+ if IO.select([@socket], nil, nil, @read_timeout)
91
+ begin
93
92
  partial_data = @socket.readpartial(10_000)
94
- end
95
- read_first_event(partial_data, latch)
96
-
97
- raise 'eof exception' if partial_data == :eof
98
- rescue Timeout::Error => e
99
- log_if_debug("SSE read operation timed out!: #{e.inspect}", 3)
100
- return Constants::PUSH_RETRYABLE_ERROR
101
- rescue EOFError => e
102
- log_if_debug("SSE read operation EOF Exception!: #{e.inspect}", 3)
103
- raise 'eof exception'
104
- rescue Errno::EAGAIN => e
105
- log_if_debug("SSE client transient error: #{e.inspect}", 1)
106
- IO.select([tcp_socket])
107
- retry
108
- rescue Errno::EBADF, IOError => e
109
- log_if_debug("SSE read operation EBADF or IOError: #{e.inspect}", 3)
110
- return nil
111
- rescue StandardError => e
112
- log_if_debug("SSE read operation StandardError: #{e.inspect}", 3)
113
- return nil if ENV['SPLITCLIENT_ENV'] == 'test'
93
+ read_first_event(partial_data, latch)
114
94
 
115
- log_if_debug("Error reading partial data: #{e.inspect}", 3)
95
+ raise 'eof exception' if partial_data == :eof
96
+ rescue IO::WaitReadable => e
97
+ log_if_debug("SSE client transient error: #{e.inspect}", 1)
98
+ IO.select([@socket], nil, nil, @read_timeout)
99
+ retry
100
+ rescue Errno::ETIMEDOUT => e
101
+ log_if_debug("SSE read operation timed out!: #{e.inspect}", 3)
102
+ return Constants::PUSH_RETRYABLE_ERROR
103
+ rescue EOFError => e
104
+ log_if_debug("SSE read operation EOF Exception!: #{e.inspect}", 3)
105
+ raise 'eof exception'
106
+ rescue Errno::EAGAIN => e
107
+ log_if_debug("SSE client transient error: #{e.inspect}", 1)
108
+ IO.select([@socket], nil, nil, @read_timeout)
109
+ retry
110
+ rescue Errno::EBADF, IOError => e
111
+ log_if_debug("SSE read operation EBADF or IOError: #{e.inspect}", 3)
112
+ return nil
113
+ rescue StandardError => e
114
+ log_if_debug("SSE read operation StandardError: #{e.inspect}", 3)
115
+ return nil if ENV['SPLITCLIENT_ENV'] == 'test'
116
+
117
+ log_if_debug("Error reading partial data: #{e.inspect}", 3)
118
+ return Constants::PUSH_RETRYABLE_ERROR
119
+ end
120
+ else
121
+ # Timeout occurred, no data available
122
+ log_if_debug("SSE read operation timed out, no data available.", 3)
116
123
  return Constants::PUSH_RETRYABLE_ERROR
117
124
  end
118
125
 
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '8.10.0-rc4'
2
+ VERSION = '8.10.0-rc5'
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: 8.10.0.pre.rc4
4
+ version: 8.10.0.pre.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software