splitclient-rb 7.1.0.pre.rc17 → 7.1.0.pre.rc18
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: 055706362ba9765e61a23912ba63e7b77c8cfa8a99513a854cb67929848ebff3
|
4
|
+
data.tar.gz: 3e15e13c3254e4e5156057218d82fe72998ecb8531d11d560e34c28fc1cf63a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6527f943f1e9309dfab9308e328e61266b828a34d8fe682be95f104e11e410eb459c2f8abde0d898f4742f8a3795b0ef4406a9d5c059321b48b5de2f74aeb84
|
7
|
+
data.tar.gz: 6e16d6b17655105edbb782696d9095b7b601164569a335538e3909d5ef770f10d9b1abd72500db9c68198ebc18f7d4cc55d5111eed36d5f5d365789eae778b37
|
@@ -86,14 +86,6 @@ module SplitIoClient
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
def stream_start_thread_forked
|
90
|
-
PhusionPassenger.on_event(:starting_worker_process) { |forked| stream_start_thread if forked }
|
91
|
-
end
|
92
|
-
|
93
|
-
def stream_start_sse_thread_forked
|
94
|
-
PhusionPassenger.on_event(:starting_worker_process) { |forked| stream_start_sse_thread if forked }
|
95
|
-
end
|
96
|
-
|
97
89
|
def start_stream_forked
|
98
90
|
PhusionPassenger.on_event(:starting_worker_process) { |forked| start_stream if forked }
|
99
91
|
end
|
@@ -65,10 +65,6 @@ module SplitIoClient
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
def connect_passenger_forked
|
69
|
-
PhusionPassenger.on_event(:starting_worker_process) { |forked| connect_thread if forked }
|
70
|
-
end
|
71
|
-
|
72
68
|
def connect_stream
|
73
69
|
interval = @back_off.interval
|
74
70
|
sleep(interval) if interval.positive?
|
@@ -111,9 +107,7 @@ module SplitIoClient
|
|
111
107
|
unless partial_data.nil? || partial_data == KEEP_ALIVE_RESPONSE
|
112
108
|
@config.logger.debug("Event partial data: #{partial_data}") if @config.debug_enabled
|
113
109
|
buffer = read_partial_data(partial_data)
|
114
|
-
|
115
|
-
|
116
|
-
dispatch_event(events)
|
110
|
+
parse_event(buffer)
|
117
111
|
end
|
118
112
|
rescue StandardError => e
|
119
113
|
@config.logger.error("process_data error: #{e.inspect}")
|
@@ -137,7 +131,6 @@ module SplitIoClient
|
|
137
131
|
|
138
132
|
def parse_event(buffer)
|
139
133
|
type = nil
|
140
|
-
events = []
|
141
134
|
|
142
135
|
buffer.each do |d|
|
143
136
|
splited_data = d.split(':')
|
@@ -147,15 +140,14 @@ module SplitIoClient
|
|
147
140
|
type = splited_data[1].strip
|
148
141
|
when 'data'
|
149
142
|
data = parse_event_data(d, type)
|
150
|
-
|
143
|
+
unless type.nil? || data[:data].nil?
|
144
|
+
event = StreamData.new(type, data[:client_id], data[:data], data[:channel])
|
145
|
+
dispatch_event(event)
|
146
|
+
end
|
151
147
|
end
|
152
148
|
end
|
153
|
-
|
154
|
-
events
|
155
149
|
rescue StandardError => e
|
156
|
-
@config.logger.error(buffer)
|
157
150
|
@config.logger.error("Error during parsing a event: #{e.inspect}")
|
158
|
-
[]
|
159
151
|
end
|
160
152
|
|
161
153
|
def parse_event_data(data, type)
|
@@ -168,13 +160,11 @@ module SplitIoClient
|
|
168
160
|
{ client_id: client_id, channel: channel, data: parsed_data }
|
169
161
|
end
|
170
162
|
|
171
|
-
def dispatch_event(
|
172
|
-
|
173
|
-
raise SSEClientException.new(event), 'Error event' if event.event_type == 'error'
|
163
|
+
def dispatch_event(event)
|
164
|
+
raise SSEClientException.new(event), 'Error event' if event.event_type == 'error'
|
174
165
|
|
175
|
-
|
176
|
-
|
177
|
-
end
|
166
|
+
@config.logger.debug("Dispatching event: #{event.event_type}, #{event.channel}") if @config.debug_enabled
|
167
|
+
@on[:event].call(event)
|
178
168
|
rescue SSEClientException => e
|
179
169
|
@config.logger.error("Event error: #{e.event.event_type}, #{e.event.data}")
|
180
170
|
close
|
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.1.0.pre.
|
4
|
+
version: 7.1.0.pre.rc18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: allocation_stats
|