sse-rails-engine 1.3.2 → 1.4.0

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
  SHA1:
3
- metadata.gz: 8c1bf469ad6ed0747ecd37f2ec91e763c4d13e19
4
- data.tar.gz: 31d54630a22eb41aee162557a4079a29928acf6f
3
+ metadata.gz: 641d77a802db300593ee25a4b134c4e78a4ee01d
4
+ data.tar.gz: 958aa8867b983ec455b5c523b8026974646c6efe
5
5
  SHA512:
6
- metadata.gz: 1a232e393a5e1ac4a3a7edd7c8305877b585e3555947b631e3bbc1b884f50aac1c84b2350b2f4ce5e1ac634cbf587841fd65b72a62e22afc82c3e70773571387
7
- data.tar.gz: 79ea29a90dade0d195280ab22bffc754c51896ae9c5f8dbab887aae7f4470ca75ac9e433111f7278c3a0d7fc87256d18c3e5e8f18ee2809e62b0bfe18debd11c
6
+ metadata.gz: 57c04caa256051787d9e98ad478471c8c47a2fefd59c5dbfbf6e03b49d89b94faad856c77400de6f0b73a5ade1b4c718294089d2e38b3b3ba04885b02a217c31
7
+ data.tar.gz: 9e33007e75e6cf7b384bcfad7d62f9399af53b33ed004eaeb42da9075a7745e5ef310d2d14c23797656d789fb1c6f0622f71603863f8c8ad75b9579abb778656
data/README.md CHANGED
@@ -73,6 +73,12 @@ SseRailsEngine.send_event('foo', '') # Sent to the client
73
73
  SseRailsEngine.send_event('other', '') # Won't be sent to the client
74
74
  ```
75
75
 
76
+ # Configuration
77
+
78
+ You can now enable the 'Access-Control-Allow-Origin' header in connection replies as well by setting:
79
+ ```SseRailsEngine.access_control_allow_origin = 'https://example.org'```
80
+
81
+
76
82
  # Notes
77
83
 
78
84
  ## Nginx
@@ -0,0 +1,13 @@
1
+ headers = [
2
+ 'HTTP/1.1 200 OK',
3
+ 'Content-Type: text/event-stream',
4
+ 'Cache-Control: no-cache, no-store',
5
+ 'Connection: close'
6
+ ]
7
+
8
+ origin = SseRailsEngine.access_control_allow_origin
9
+ headers << "Access-Control-Allow-Origin: #{origin}" if origin
10
+
11
+ headers << '' << ''
12
+
13
+ SseRailsEngine::Connection.sse_header = headers.join("\r\n").freeze
@@ -1,2 +1 @@
1
-
2
1
  Rails.configuration.middleware.delete 'Rack::Lock'
@@ -3,9 +3,9 @@ require 'sse_rails_engine/connection'
3
3
  require 'sse_rails_engine/manager'
4
4
 
5
5
  module SseRailsEngine
6
- mattr_accessor :heartbeat_interval
6
+ mattr_accessor :heartbeat_interval, :access_control_allow_origin
7
7
 
8
- @@heartbeat_interval = 5.seconds
8
+ self.heartbeat_interval = 5.seconds
9
9
 
10
10
  def self.manager
11
11
  @manager ||= Manager.new
@@ -1,16 +1,11 @@
1
1
  module SseRailsEngine
2
2
  class Connection
3
3
  attr_accessor :stream, :channels
4
-
5
- SSE_HEADER = ["HTTP/1.1 200 OK\r\n",
6
- "Content-Type: text/event-stream\r\n",
7
- "Cache-Control: no-cache, no-store\r\n",
8
- "Connection: close\r\n",
9
- "\r\n"].join.freeze
4
+ cattr_accessor :sse_header
10
5
 
11
6
  def initialize(io, env)
12
7
  @socket = io
13
- @socket.write SSE_HEADER
8
+ @socket.write(sse_header)
14
9
  @socket.flush
15
10
  @stream = ActionController::Live::SSE.new(io)
16
11
  @channels = requested_channels(env)
@@ -26,7 +21,7 @@ module SseRailsEngine
26
21
 
27
22
  def filtered?(channel)
28
23
  return false if @channels.empty? || channel == Manager::HEARTBEAT_EVENT
29
- !@channels.include? channel
24
+ !@channels.include?(channel)
30
25
  end
31
26
 
32
27
  def requested_channels(env)
@@ -1,3 +1,3 @@
1
1
  module SseRailsEngine
2
- VERSION = '1.3.2'
2
+ VERSION = '1.4.0'
3
3
  end
@@ -11,6 +11,8 @@ require "rails/test_unit/railtie"
11
11
  Bundler.require(*Rails.groups)
12
12
  require "sse-rails-engine"
13
13
 
14
+ SseRailsEngine.access_control_allow_origin = 'https://example.org'
15
+
14
16
  module Dummy
15
17
  class Application < Rails::Application
16
18
  # Settings in config/environments/* take precedence over those specified here.
@@ -26,4 +28,3 @@ module Dummy
26
28
  # config.i18n.default_locale = :de
27
29
  end
28
30
  end
29
-
@@ -0,0 +1,743 @@
1
+ Starting SSE heartbeat thread!
2
+ Starting SSE heartbeat thread!
3
+ Starting SSE heartbeat thread!
4
+ Starting SSE heartbeat thread!
5
+ Starting SSE heartbeat thread!
6
+ Starting SSE heartbeat thread!
7
+ Starting SSE heartbeat thread!
8
+ Starting SSE heartbeat thread!
9
+ Starting SSE heartbeat thread!
10
+ Starting SSE heartbeat thread!
11
+ Starting SSE heartbeat thread!
12
+ Starting SSE heartbeat thread!
13
+ Starting SSE heartbeat thread!
14
+ Starting SSE heartbeat thread!
15
+ Starting SSE heartbeat thread!
16
+ Starting SSE heartbeat thread!
17
+ New SSE Client connected: #<StringIO:0x007fc5cb2272a0>
18
+ Failed to send event to SSE: #<StringIO:0x007fc5cb2272a0> (foo, bar - RuntimeError (RuntimeError
19
+ Starting SSE heartbeat thread!
20
+ Starting SSE heartbeat thread!
21
+ New SSE Client connected: #<StringIO:0x007fe0c42c4190>
22
+ Starting SSE heartbeat thread!
23
+ Starting SSE heartbeat thread!
24
+ Starting SSE heartbeat thread!
25
+ Starting SSE heartbeat thread!
26
+ Starting SSE heartbeat thread!
27
+ Starting SSE heartbeat thread!
28
+ Starting SSE heartbeat thread!
29
+ Starting SSE heartbeat thread!
30
+ Starting SSE heartbeat thread!
31
+ Starting SSE heartbeat thread!
32
+ Starting SSE heartbeat thread!
33
+ Starting SSE heartbeat thread!
34
+ Starting SSE heartbeat thread!
35
+ Starting SSE heartbeat thread!
36
+ Starting SSE heartbeat thread!
37
+ Starting SSE heartbeat thread!
38
+ Starting SSE heartbeat thread!
39
+ New SSE Client connected: #<StringIO:0x007f97591563a8>
40
+ SSE Client disconnected: #<StringIO:0x007f97591563a8>
41
+ Starting SSE heartbeat thread!
42
+ New SSE Client connected: #<StringIO:0x007f975914ef18>
43
+ Starting SSE heartbeat thread!
44
+ New SSE Client connected: #<StringIO:0x007f97591474e8>
45
+ Failed to send event to SSE: #<StringIO:0x007f97591474e8> (foo, bar - RuntimeError (RuntimeError
46
+ Starting SSE heartbeat thread!
47
+ Starting SSE heartbeat thread!
48
+ New SSE Client connected: #<StringIO:0x007f975913dba0>
49
+ Starting SSE heartbeat thread!
50
+ Starting SSE heartbeat thread!
51
+ Starting SSE heartbeat thread!
52
+ New SSE Client connected: #<StringIO:0x007f9759124f88>
53
+ Starting SSE heartbeat thread!
54
+ New SSE Client connected: #<StringIO:0x007f975911ec50>
55
+ Starting SSE heartbeat thread!
56
+ Starting SSE heartbeat thread!
57
+ Starting SSE heartbeat thread!
58
+ New SSE Client connected: #<StringIO:0x007ff3392c3a88>
59
+ Failed to send event to SSE: #<StringIO:0x007ff3392c3a88> (foo, bar - RuntimeError (RuntimeError
60
+ Starting SSE heartbeat thread!
61
+ New SSE Client connected: #<StringIO:0x007ff3392ba4b0>
62
+ Starting SSE heartbeat thread!
63
+ New SSE Client connected: #<StringIO:0x007ff3392aad08>
64
+ Starting SSE heartbeat thread!
65
+ Starting SSE heartbeat thread!
66
+ New SSE Client connected: #<StringIO:0x007ff339282bf0>
67
+ Starting SSE heartbeat thread!
68
+ New SSE Client connected: #<StringIO:0x007ff33927b4b8>
69
+ SSE Client disconnected: #<StringIO:0x007ff33927b4b8>
70
+ Starting SSE heartbeat thread!
71
+ New SSE Client connected: #<StringIO:0x007ff339278948>
72
+ Starting SSE heartbeat thread!
73
+ Starting SSE heartbeat thread!
74
+ Starting SSE heartbeat thread!
75
+ Starting SSE heartbeat thread!
76
+ New SSE Client connected: #<StringIO:0x007fcdfb259ec0>
77
+ Starting SSE heartbeat thread!
78
+ Starting SSE heartbeat thread!
79
+ New SSE Client connected: #<StringIO:0x007fcdfb230ef8>
80
+ Starting SSE heartbeat thread!
81
+ Starting SSE heartbeat thread!
82
+ New SSE Client connected: #<StringIO:0x007fcdfb21bc88>
83
+ Failed to send event to SSE: #<StringIO:0x007fcdfb21bc88> (foo, bar - RuntimeError (RuntimeError
84
+ Starting SSE heartbeat thread!
85
+ Starting SSE heartbeat thread!
86
+ New SSE Client connected: #<StringIO:0x007fcdfb2035c0>
87
+ SSE Client disconnected: #<StringIO:0x007fcdfb2035c0>
88
+ Starting SSE heartbeat thread!
89
+ New SSE Client connected: #<StringIO:0x007fcdfb200938>
90
+ Starting SSE heartbeat thread!
91
+ New SSE Client connected: #<StringIO:0x007fcdfb1fa290>
92
+ Starting SSE heartbeat thread!
93
+ Starting SSE heartbeat thread!
94
+ Starting SSE heartbeat thread!
95
+ Starting SSE heartbeat thread!
96
+ New SSE Client connected: #<StringIO:0x007fa81cd396b0>
97
+ Failed to send event to SSE: #<StringIO:0x007fa81cd396b0> (foo, bar - RuntimeError (RuntimeError
98
+ Starting SSE heartbeat thread!
99
+ Starting SSE heartbeat thread!
100
+ New SSE Client connected: #<StringIO:0x007fa81cd33288>
101
+ Starting SSE heartbeat thread!
102
+ New SSE Client connected: #<StringIO:0x007fa81cd23b58>
103
+ Starting SSE heartbeat thread!
104
+ New SSE Client connected: #<StringIO:0x007fa81cd21038>
105
+ Starting SSE heartbeat thread!
106
+ Starting SSE heartbeat thread!
107
+ New SSE Client connected: #<StringIO:0x007fa81cd13c80>
108
+ SSE Client disconnected: #<StringIO:0x007fa81cd13c80>
109
+ Starting SSE heartbeat thread!
110
+ New SSE Client connected: #<StringIO:0x007fa81cd10cd8>
111
+ Starting SSE heartbeat thread!
112
+ Starting SSE heartbeat thread!
113
+ New SSE Client connected: #<StringIO:0x007fd37d510920>
114
+ Failed to send event to SSE: #<StringIO:0x007fd37d510920> (foo, bar - RuntimeError (RuntimeError
115
+ Starting SSE heartbeat thread!
116
+ New SSE Client connected: #<StringIO:0x007fd37d4f9a40>
117
+ Starting SSE heartbeat thread!
118
+ Starting SSE heartbeat thread!
119
+ Starting SSE heartbeat thread!
120
+ New SSE Client connected: #<StringIO:0x007fd37d4d8368>
121
+ Starting SSE heartbeat thread!
122
+ New SSE Client connected: #<StringIO:0x007fd37d4c2a68>
123
+ SSE Client disconnected: #<StringIO:0x007fd37d4c2a68>
124
+ Starting SSE heartbeat thread!
125
+ New SSE Client connected: #<StringIO:0x007fd37d4bb9c0>
126
+ Starting SSE heartbeat thread!
127
+ New SSE Client connected: #<StringIO:0x007fd37d4b95f8>
128
+ Starting SSE heartbeat thread!
129
+ Starting SSE heartbeat thread!
130
+ Starting SSE heartbeat thread!
131
+ Starting SSE heartbeat thread!
132
+ New SSE Client connected: #<StringIO:0x007ff76cdeae70>
133
+ SSE Client disconnected: #<StringIO:0x007ff76cdeae70>
134
+ Starting SSE heartbeat thread!
135
+ New SSE Client connected: #<StringIO:0x007ff76cde3f30>
136
+ Starting SSE heartbeat thread!
137
+ Starting SSE heartbeat thread!
138
+ Starting SSE heartbeat thread!
139
+ New SSE Client connected: #<StringIO:0x007ff76cdcb728>
140
+ Starting SSE heartbeat thread!
141
+ Starting SSE heartbeat thread!
142
+ New SSE Client connected: #<StringIO:0x007ff76cdb2fe8>
143
+ Starting SSE heartbeat thread!
144
+ New SSE Client connected: #<StringIO:0x007ff76cdb0838>
145
+ Starting SSE heartbeat thread!
146
+ New SSE Client connected: #<StringIO:0x007ff76cda0118>
147
+ Failed to send event to SSE: #<StringIO:0x007ff76cda0118> (foo, bar - RuntimeError (RuntimeError
148
+ Starting SSE heartbeat thread!
149
+ Starting SSE heartbeat thread!
150
+ New SSE Client connected: #<StringIO:0x007f8ae344fe88>
151
+ New SSE Client connected: #<StringIO:0x007f8ae345c5c0>
152
+ Starting SSE heartbeat thread!
153
+ Starting SSE heartbeat thread!
154
+ New SSE Client connected: #<StringIO:0x007f98fbe791b8>
155
+ New SSE Client connected: #<StringIO:0x007f98fbe797f8>
156
+ Starting SSE heartbeat thread!
157
+ Starting SSE heartbeat thread!
158
+ New SSE Client connected: #<StringIO:0x007fa5842f1f80>
159
+ New SSE Client connected: #<StringIO:0x007fa5842f2480>
160
+ Starting SSE heartbeat thread!
161
+ Starting SSE heartbeat thread!
162
+ New SSE Client connected: #<StringIO:0x007ffe6c069308>
163
+ New SSE Client connected: #<StringIO:0x007ffe6c06a618>
164
+ Starting SSE heartbeat thread!
165
+ Starting SSE heartbeat thread!
166
+ New SSE Client connected: #<StringIO:0x007ffc85471538>
167
+ New SSE Client connected: #<StringIO:0x007ffc85471e48>
168
+ Starting SSE heartbeat thread!
169
+ Starting SSE heartbeat thread!
170
+ New SSE Client connected: #<StringIO:0x007fe576fe1330>
171
+ New SSE Client connected: #<StringIO:0x007fe576fe1d30>
172
+ Starting SSE heartbeat thread!
173
+ Starting SSE heartbeat thread!
174
+ New SSE Client connected: #<StringIO:0x007f80c45c2cd0>
175
+ New SSE Client connected: #<StringIO:0x007f80c45c36a8>
176
+ Starting SSE heartbeat thread!
177
+ Starting SSE heartbeat thread!
178
+ New SSE Client connected: #<StringIO:0x007fb0cde30c80>
179
+ New SSE Client connected: #<StringIO:0x007fb0cde314f0>
180
+ Starting SSE heartbeat thread!
181
+ Starting SSE heartbeat thread!
182
+ New SSE Client connected: #<StringIO:0x007fb95c5c9758>
183
+ New SSE Client connected: #<StringIO:0x007fb95c5c88a8>
184
+ Starting SSE heartbeat thread!
185
+ Starting SSE heartbeat thread!
186
+ New SSE Client connected: #<StringIO:0x007fb3c8f8e5c0>
187
+ New SSE Client connected: #<StringIO:0x007fb3c8f8ed90>
188
+ Starting SSE heartbeat thread!
189
+ Starting SSE heartbeat thread!
190
+ New SSE Client connected: #<StringIO:0x007f95fcc63ce0>
191
+ New SSE Client connected: #<StringIO:0x007f95fcc70670>
192
+ Starting SSE heartbeat thread!
193
+ Starting SSE heartbeat thread!
194
+ New SSE Client connected: #<StringIO:0x007fc68bd72090>
195
+ Failed to send event to SSE: #<StringIO:0x007fc68bd72090> (foo, bar - undefined method `channels' for #<Hash:0x007fc68bd70e98> (NoMethodError
196
+ Starting SSE heartbeat thread!
197
+ New SSE Client connected: #<StringIO:0x007fc68bd696c0>
198
+ Starting SSE heartbeat thread!
199
+ Starting SSE heartbeat thread!
200
+ New SSE Client connected: #<StringIO:0x007fc68bd5a4e0>
201
+ Failed to send event to SSE: #<StringIO:0x007fc68bd5a4e0> (foo, bar - undefined method `channels' for #<Hash:0x007fc68bd59e00> (NoMethodError
202
+ Starting SSE heartbeat thread!
203
+ Starting SSE heartbeat thread!
204
+ Starting SSE heartbeat thread!
205
+ New SSE Client connected: #<StringIO:0x007fc68bd2b028>
206
+ Failed to send event to SSE: #<StringIO:0x007fc68bd2b028> (foo, bar - undefined method `channels' for #<Hash:0x007fc68bd2a7e0> (NoMethodError
207
+ Starting SSE heartbeat thread!
208
+ New SSE Client connected: #<StringIO:0x007fc68bd12f00>
209
+ New SSE Client connected: #<StringIO:0x007fc68bd13518>
210
+ Starting SSE heartbeat thread!
211
+ ENV:
212
+ New SSE Client connected: #<StringIO:0x007fc68bd027b8>
213
+ Starting SSE heartbeat thread!
214
+ New SSE Client connected: #<StringIO:0x007fc68bd001e8>
215
+ Failed to send event to SSE: #<StringIO:0x007fc68bd001e8> (foo, {:a=>123, "b"=>"abc", :c=>{:foo=>"bar"}} - undefined method `channels' for #<Hash:0x007fc68bcfbd00> (NoMethodError
216
+ Starting SSE heartbeat thread!
217
+ Starting SSE heartbeat thread!
218
+ New SSE Client connected: #<StringIO:0x007f8f6e5818f8>
219
+ Starting SSE heartbeat thread!
220
+ Starting SSE heartbeat thread!
221
+ New SSE Client connected: #<StringIO:0x007f9abb84bb58>
222
+ Starting SSE heartbeat thread!
223
+ Starting SSE heartbeat thread!
224
+ New SSE Client connected: #<StringIO:0x007fe4a5373890>
225
+ Starting SSE heartbeat thread!
226
+ Starting SSE heartbeat thread!
227
+ New SSE Client connected: #<StringIO:0x007fcffa778590>
228
+ New SSE Client connected: #<StringIO:0x007fcffa778dd8>
229
+ Starting SSE heartbeat thread!
230
+ Starting SSE heartbeat thread!
231
+ New SSE Client connected: #<StringIO:0x007ff97c572ec0>
232
+ New SSE Client connected: #<StringIO:0x007ff97c573690>
233
+ Starting SSE heartbeat thread!
234
+ Starting SSE heartbeat thread!
235
+ New SSE Client connected: #<StringIO:0x007fc5850f9068>
236
+ Starting SSE heartbeat thread!
237
+ New SSE Client connected: #<StringIO:0x007fc5850f1408>
238
+ Starting SSE heartbeat thread!
239
+ New SSE Client connected: #<StringIO:0x007fc5850d2f30>
240
+ Starting SSE heartbeat thread!
241
+ New SSE Client connected: #<StringIO:0x007fc5850aa648>
242
+ New SSE Client connected: #<StringIO:0x007fc5850aaaf8>
243
+ Starting SSE heartbeat thread!
244
+ New SSE Client connected: #<StringIO:0x007fc5850a1930>
245
+ Starting SSE heartbeat thread!
246
+ New SSE Client connected: #<StringIO:0x007fc5850912b0>
247
+ Starting SSE heartbeat thread!
248
+ Starting SSE heartbeat thread!
249
+ Starting SSE heartbeat thread!
250
+ Starting SSE heartbeat thread!
251
+ New SSE Client connected: #<StringIO:0x007fc585072658>
252
+ Starting SSE heartbeat thread!
253
+ Starting SSE heartbeat thread!
254
+ New SSE Client connected: #<StringIO:0x007f8d6ec10c70>
255
+ New SSE Client connected: #<StringIO:0x007f8d6ec11468>
256
+ Starting SSE heartbeat thread!
257
+ Starting SSE heartbeat thread!
258
+ New SSE Client connected: #<StringIO:0x007f91c60c1d68>
259
+ New SSE Client connected: #<StringIO:0x007f91c60c2560>
260
+ Starting SSE heartbeat thread!
261
+ Starting SSE heartbeat thread!
262
+ Starting SSE heartbeat thread!
263
+ New SSE Client connected: #<StringIO:0x007fb0829b5bd8>
264
+ Starting SSE heartbeat thread!
265
+ New SSE Client connected: #<StringIO:0x007fb0829a64f8>
266
+ Starting SSE heartbeat thread!
267
+ Starting SSE heartbeat thread!
268
+ New SSE Client connected: #<StringIO:0x007fb082955580>
269
+ Starting SSE heartbeat thread!
270
+ Starting SSE heartbeat thread!
271
+ New SSE Client connected: #<StringIO:0x007fb082917988>
272
+ Starting SSE heartbeat thread!
273
+ New SSE Client connected: #<StringIO:0x007fb0828a9140>
274
+ Starting SSE heartbeat thread!
275
+ New SSE Client connected: #<StringIO:0x007fb082861cf0>
276
+ Starting SSE heartbeat thread!
277
+ New SSE Client connected: #<StringIO:0x007fb082841c98>
278
+ New SSE Client connected: #<StringIO:0x007fb082842508>
279
+ Starting SSE heartbeat thread!
280
+ Starting SSE heartbeat thread!
281
+ New SSE Client connected: #<StringIO:0x007fd343f735f0>
282
+ New SSE Client connected: #<StringIO:0x007fd343f73dc0>
283
+ Starting SSE heartbeat thread!
284
+ Starting SSE heartbeat thread!
285
+ New SSE Client connected: #<StringIO:0x007fe58c1a14d0>
286
+ New SSE Client connected: #<StringIO:0x007fe58c1a1b10>
287
+ Starting SSE heartbeat thread!
288
+ Starting SSE heartbeat thread!
289
+ New SSE Client connected: #<StringIO:0x007ff49e6d3f90>
290
+ New SSE Client connected: #<StringIO:0x007ff49e6e0e20>
291
+ SSE Client disconnected: #<StringIO:0x007ff49e6e0e20> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
292
+ Starting SSE heartbeat thread!
293
+ Starting SSE heartbeat thread!
294
+ New SSE Client connected: #<StringIO:0x007f9b99299f28>
295
+ New SSE Client connected: #<StringIO:0x007f9b9929a658>
296
+ SSE Client disconnected: #<StringIO:0x007f9b99299f28> - undefined local variable or method `channel' for #<SseRailsEngine::Connection:0x007f9b99299b18>
297
+ SSE Client disconnected: #<StringIO:0x007f9b9929a658> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
298
+ Starting SSE heartbeat thread!
299
+ Starting SSE heartbeat thread!
300
+ New SSE Client connected: #<StringIO:0x007fa17455ad80>
301
+ New SSE Client connected: #<StringIO:0x007fa17455b5f0>
302
+ SSE Client disconnected: #<StringIO:0x007fa17455b5f0> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
303
+ Starting SSE heartbeat thread!
304
+ Starting SSE heartbeat thread!
305
+ New SSE Client connected: #<StringIO:0x007f9b5d5aa500>
306
+ New SSE Client connected: #<StringIO:0x007f9b5d5aad20>
307
+ SSE Client disconnected: #<StringIO:0x007f9b5d5aad20> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
308
+ Starting SSE heartbeat thread!
309
+ Starting SSE heartbeat thread!
310
+ New SSE Client connected: #<StringIO:0x007f908134f878>
311
+ New SSE Client connected: #<StringIO:0x007f90813740b0>
312
+ SSE Client disconnected: #<StringIO:0x007f90813740b0> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
313
+ Starting SSE heartbeat thread!
314
+ Starting SSE heartbeat thread!
315
+ New SSE Client connected: #<StringIO:0x007f8666022c38>
316
+ Starting SSE heartbeat thread!
317
+ Starting SSE heartbeat thread!
318
+ New SSE Client connected: #<StringIO:0x007f8665f70ee8>
319
+ SSE Client disconnected: #<StringIO:0x007f8665f70ee8> - RuntimeError
320
+ Starting SSE heartbeat thread!
321
+ New SSE Client connected: #<StringIO:0x007f8665f512f0>
322
+ Starting SSE heartbeat thread!
323
+ Starting SSE heartbeat thread!
324
+ New SSE Client connected: #<StringIO:0x007f8665f01200>
325
+ Starting SSE heartbeat thread!
326
+ New SSE Client connected: #<StringIO:0x007f8665ee2a08>
327
+ New SSE Client connected: #<StringIO:0x007f8665ee31d8>
328
+ SSE Client disconnected: #<StringIO:0x007f8665ee31d8> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
329
+ Starting SSE heartbeat thread!
330
+ New SSE Client connected: #<StringIO:0x007f8665ea0b80>
331
+ SSE Client disconnected: #<StringIO:0x007f8665ea0b80> - IOError
332
+ Starting SSE heartbeat thread!
333
+ New SSE Client connected: #<StringIO:0x007f8665e81348>
334
+ Starting SSE heartbeat thread!
335
+ Starting SSE heartbeat thread!
336
+ Starting SSE heartbeat thread!
337
+ New SSE Client connected: #<StringIO:0x007fdbbdb9b360>
338
+ Starting SSE heartbeat thread!
339
+ New SSE Client connected: #<StringIO:0x007fdbbdb7abd8>
340
+ Starting SSE heartbeat thread!
341
+ Starting SSE heartbeat thread!
342
+ New SSE Client connected: #<StringIO:0x007fdbbdb387d8>
343
+ Starting SSE heartbeat thread!
344
+ New SSE Client connected: #<StringIO:0x007fdbbdb0bfa8>
345
+ SSE Client disconnected: #<StringIO:0x007fdbbdb0bfa8> - IOError
346
+ Starting SSE heartbeat thread!
347
+ Starting SSE heartbeat thread!
348
+ New SSE Client connected: #<StringIO:0x007fdbbdadad40>
349
+ Starting SSE heartbeat thread!
350
+ New SSE Client connected: #<StringIO:0x007fdbbdaaa640>
351
+ SSE Client disconnected: #<StringIO:0x007fdbbdaaa640> - RuntimeError
352
+ Starting SSE heartbeat thread!
353
+ Starting SSE heartbeat thread!
354
+ New SSE Client connected: #<StringIO:0x007fdbbda6bdf0>
355
+ New SSE Client connected: #<StringIO:0x007fdbbda784d8>
356
+ SSE Client disconnected: #<StringIO:0x007fdbbda784d8> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
357
+ Starting SSE heartbeat thread!
358
+ Starting SSE heartbeat thread!
359
+ New SSE Client connected: #<StringIO:0x007fb07d2394b8>
360
+ New SSE Client connected: #<StringIO:0x007fb07d23a430>
361
+ SSE Client disconnected: #<StringIO:0x007fb07d23a430> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
362
+ Starting SSE heartbeat thread!
363
+ New SSE Client connected: #<StringIO:0x007fb07d1ea408>
364
+ New SSE Client connected: #<StringIO:0x007fb07d1eab10>
365
+ SSE Client disconnected: #<StringIO:0x007fb07d1eab10> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
366
+ Starting SSE heartbeat thread!
367
+ Starting SSE heartbeat thread!
368
+ New SSE Client connected: #<StringIO:0x007fd5864badf8>
369
+ New SSE Client connected: #<StringIO:0x007fd5864bb410>
370
+ SSE Client disconnected: #<StringIO:0x007fd5864bb410> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
371
+ Starting SSE heartbeat thread!
372
+ New SSE Client connected: #<StringIO:0x007fd58647a6e0>
373
+ New SSE Client connected: #<StringIO:0x007fd58647ae38>
374
+ SSE Client disconnected: #<StringIO:0x007fd58647ae38> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
375
+ Starting SSE heartbeat thread!
376
+ Starting SSE heartbeat thread!
377
+ New SSE Client connected: #<StringIO:0x007fcecbe52a30>
378
+ SSE Client disconnected: #<StringIO:0x007fcecbe52a30> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
379
+ Starting SSE heartbeat thread!
380
+ New SSE Client connected: #<StringIO:0x007fcecbdf28d8>
381
+ New SSE Client connected: #<StringIO:0x007fcecbdf3120>
382
+ SSE Client disconnected: #<StringIO:0x007fcecbdf3120> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
383
+ Starting SSE heartbeat thread!
384
+ Starting SSE heartbeat thread!
385
+ New SSE Client connected: #<StringIO:0x007fa16ca24c38>
386
+ SSE Client disconnected: #<StringIO:0x007fa16ca24c38> - uninitialized constant SseRailsEngine::Connection::HEARTBEAT_EVENT
387
+ Starting SSE heartbeat thread!
388
+ Starting SSE heartbeat thread!
389
+ New SSE Client connected: #<StringIO:0x007fca446a1588>
390
+ Starting SSE heartbeat thread!
391
+ Starting SSE heartbeat thread!
392
+ New SSE Client connected: #<StringIO:0x007ff605c1a8d8>
393
+ Starting SSE heartbeat thread!
394
+ Starting SSE heartbeat thread!
395
+ New SSE Client connected: #<StringIO:0x007ffc9df80218>
396
+ Starting SSE heartbeat thread!
397
+ New SSE Client connected: #<StringIO:0x007ffc9df53f60>
398
+ Starting SSE heartbeat thread!
399
+ New SSE Client connected: #<StringIO:0x007ffc9df41590>
400
+ New SSE Client connected: #<StringIO:0x007ffc9df41d10>
401
+ Starting SSE heartbeat thread!
402
+ Starting SSE heartbeat thread!
403
+ New SSE Client connected: #<StringIO:0x007ffc9deb9cd0>
404
+ Starting SSE heartbeat thread!
405
+ Starting SSE heartbeat thread!
406
+ New SSE Client connected: #<StringIO:0x007ffc9de88c48>
407
+ Starting SSE heartbeat thread!
408
+ New SSE Client connected: #<StringIO:0x007ffc9de5aa00>
409
+ Starting SSE heartbeat thread!
410
+ Starting SSE heartbeat thread!
411
+ New SSE Client connected: #<StringIO:0x007ffc9de19e38>
412
+ Starting SSE heartbeat thread!
413
+ New SSE Client connected: #<StringIO:0x007ffc9ddf84e0>
414
+ SSE Client disconnected: #<StringIO:0x007ffc9ddf84e0> - IOError
415
+ Starting SSE heartbeat thread!
416
+ Starting SSE heartbeat thread!
417
+ New SSE Client connected: #<StringIO:0x007f9fa485bb50>
418
+ New SSE Client connected: #<StringIO:0x007f9fa48682d8>
419
+ Starting SSE heartbeat thread!
420
+ Starting SSE heartbeat thread!
421
+ New SSE Client connected: #<StringIO:0x007fcfbb8983d8>
422
+ Starting SSE heartbeat thread!
423
+ New SSE Client connected: #<StringIO:0x007fcfbb843450>
424
+ Starting SSE heartbeat thread!
425
+ Starting SSE heartbeat thread!
426
+ New SSE Client connected: #<StringIO:0x007fcfbb8113d8>
427
+ New SSE Client connected: #<StringIO:0x007fcfbb8125d0>
428
+ Starting SSE heartbeat thread!
429
+ Starting SSE heartbeat thread!
430
+ New SSE Client connected: #<StringIO:0x007fcfbb7c8ac0>
431
+ SSE Client disconnected: #<StringIO:0x007fcfbb7c8ac0> - IOError
432
+ Starting SSE heartbeat thread!
433
+ New SSE Client connected: #<StringIO:0x007fcfbb7a8978>
434
+ Starting SSE heartbeat thread!
435
+ Starting SSE heartbeat thread!
436
+ New SSE Client connected: #<StringIO:0x007fcfbb759990>
437
+ Starting SSE heartbeat thread!
438
+ New SSE Client connected: #<StringIO:0x007fcfbb73b710>
439
+ Starting SSE heartbeat thread!
440
+ New SSE Client connected: #<StringIO:0x007fcfbb71a538>
441
+ Starting SSE heartbeat thread!
442
+ New SSE Client connected: #<StringIO:0x007fcfbb6f9158>
443
+ Starting SSE heartbeat thread!
444
+ Starting SSE heartbeat thread!
445
+ Starting SSE heartbeat thread!
446
+ New SSE Client connected: #<StringIO:0x007f807cdaa4e0>
447
+ Starting SSE heartbeat thread!
448
+ New SSE Client connected: #<StringIO:0x007f807cd88bd8>
449
+ SSE Client disconnected: #<StringIO:0x007f807cd88bd8> - IOError
450
+ Starting SSE heartbeat thread!
451
+ New SSE Client connected: #<StringIO:0x007f807cd69300>
452
+ Starting SSE heartbeat thread!
453
+ New SSE Client connected: #<StringIO:0x007f807cd4af18>
454
+ Starting SSE heartbeat thread!
455
+ New SSE Client connected: #<StringIO:0x007f807cd38d90>
456
+ Starting SSE heartbeat thread!
457
+ New SSE Client connected: #<StringIO:0x007f807cd19418>
458
+ New SSE Client connected: #<StringIO:0x007f807cd19fa8>
459
+ Starting SSE heartbeat thread!
460
+ New SSE Client connected: #<StringIO:0x007f807ccebbf8>
461
+ Starting SSE heartbeat thread!
462
+ Starting SSE heartbeat thread!
463
+ New SSE Client connected: #<StringIO:0x007f807ccaaa68>
464
+ Starting SSE heartbeat thread!
465
+ New SSE Client connected: #<StringIO:0x007f807cc8a560>
466
+ Starting SSE heartbeat thread!
467
+ Starting SSE heartbeat thread!
468
+ Starting SSE heartbeat thread!
469
+ New SSE Client connected: #<StringIO:0x007fee75441978>
470
+ Starting SSE heartbeat thread!
471
+ New SSE Client connected: #<StringIO:0x007fee753dbf88>
472
+ SSE Client disconnected: #<StringIO:0x007fee753dbf88> - IOError
473
+ Starting SSE heartbeat thread!
474
+ New SSE Client connected: #<StringIO:0x007fee753bac20>
475
+ Starting SSE heartbeat thread!
476
+ New SSE Client connected: #<StringIO:0x007fee7539ada8>
477
+ Starting SSE heartbeat thread!
478
+ New SSE Client connected: #<StringIO:0x007fee7537abe8>
479
+ New SSE Client connected: #<StringIO:0x007fee7537b430>
480
+ Starting SSE heartbeat thread!
481
+ New SSE Client connected: #<StringIO:0x007fee7535b2c0>
482
+ Starting SSE heartbeat thread!
483
+ New SSE Client connected: #<StringIO:0x007fee753496b0>
484
+ Starting SSE heartbeat thread!
485
+ New SSE Client connected: #<StringIO:0x007fee75328640>
486
+ SSE Client disconnected: #<StringIO:0x007fee75328640> - IOError
487
+ Starting SSE heartbeat thread!
488
+ Starting SSE heartbeat thread!
489
+ Starting SSE heartbeat thread!
490
+ New SSE Client connected: #<StringIO:0x007fee752ab578>
491
+ Starting SSE heartbeat thread!
492
+ Starting SSE heartbeat thread!
493
+ Starting SSE heartbeat thread!
494
+ New SSE Client connected: #<StringIO:0x007ff5753a8f00>
495
+ Starting SSE heartbeat thread!
496
+ New SSE Client connected: #<StringIO:0x007ff57538ae38>
497
+ Starting SSE heartbeat thread!
498
+ Starting SSE heartbeat thread!
499
+ New SSE Client connected: #<StringIO:0x007ff575370fd8>
500
+ New SSE Client connected: #<StringIO:0x007ff575371500>
501
+ Starting SSE heartbeat thread!
502
+ Starting SSE heartbeat thread!
503
+ Starting SSE heartbeat thread!
504
+ New SSE Client connected: #<StringIO:0x007ff575352740>
505
+ Starting SSE heartbeat thread!
506
+ New SSE Client connected: #<StringIO:0x007ff57534b760>
507
+ Starting SSE heartbeat thread!
508
+ New SSE Client connected: #<StringIO:0x007ff575343b50>
509
+ SSE Client disconnected: #<StringIO:0x007ff575343b50> - IOError
510
+ Starting SSE heartbeat thread!
511
+ New SSE Client connected: #<StringIO:0x007ff57533b568>
512
+ Starting SSE heartbeat thread!
513
+ New SSE Client connected: #<StringIO:0x007ff5753380e8>
514
+ Starting SSE heartbeat thread!
515
+ New SSE Client connected: #<StringIO:0x007ff57532aec0>
516
+ SSE Client disconnected: #<StringIO:0x007ff57532aec0> - IOError
517
+ Starting SSE heartbeat thread!
518
+ Starting SSE heartbeat thread!
519
+ New SSE Client connected: #<StringIO:0x007f864bdfb438>
520
+ SSE Client disconnected: #<StringIO:0x007f864bdfb438> - IOError
521
+ Starting SSE heartbeat thread!
522
+ New SSE Client connected: #<StringIO:0x007f864bdfa5d8>
523
+ Starting SSE heartbeat thread!
524
+ New SSE Client connected: #<StringIO:0x007f864bdeba60>
525
+ Starting SSE heartbeat thread!
526
+ Starting SSE heartbeat thread!
527
+ Starting SSE heartbeat thread!
528
+ New SSE Client connected: #<StringIO:0x007f864bdd94f0>
529
+ Starting SSE heartbeat thread!
530
+ New SSE Client connected: #<StringIO:0x007f864bdd12a0>
531
+ Starting SSE heartbeat thread!
532
+ New SSE Client connected: #<StringIO:0x007f864bdc9488>
533
+ SSE Client disconnected: #<StringIO:0x007f864bdc9488> - IOError
534
+ Starting SSE heartbeat thread!
535
+ Starting SSE heartbeat thread!
536
+ New SSE Client connected: #<StringIO:0x007f864bdc0680>
537
+ Starting SSE heartbeat thread!
538
+ New SSE Client connected: #<StringIO:0x007f864bdb9a88>
539
+ Starting SSE heartbeat thread!
540
+ New SSE Client connected: #<StringIO:0x007f864bdb27b0>
541
+ New SSE Client connected: #<StringIO:0x007f864bdb2f58>
542
+ Starting SSE heartbeat thread!
543
+ Starting SSE heartbeat thread!
544
+ New SSE Client connected: #<StringIO:0x007fdd7a921c10>
545
+ Starting SSE heartbeat thread!
546
+ New SSE Client connected: #<StringIO:0x007fdd7a91ae10>
547
+ Starting SSE heartbeat thread!
548
+ Starting SSE heartbeat thread!
549
+ New SSE Client connected: #<StringIO:0x007fdd7a90bfa0>
550
+ SSE Client disconnected: #<StringIO:0x007fdd7a90bfa0> - IOError
551
+ Starting SSE heartbeat thread!
552
+ New SSE Client connected: #<StringIO:0x007fdd7a9087b0>
553
+ New SSE Client connected: #<StringIO:0x007fdd7a908e68>
554
+ Starting SSE heartbeat thread!
555
+ New SSE Client connected: #<StringIO:0x007fdd7a9019b0>
556
+ Starting SSE heartbeat thread!
557
+ New SSE Client connected: #<StringIO:0x007fdd7a8fa778>
558
+ Starting SSE heartbeat thread!
559
+ New SSE Client connected: #<StringIO:0x007fdd7a8f8270>
560
+ Starting SSE heartbeat thread!
561
+ Starting SSE heartbeat thread!
562
+ Starting SSE heartbeat thread!
563
+ New SSE Client connected: #<StringIO:0x007fdd7a8daf18>
564
+ SSE Client disconnected: #<StringIO:0x007fdd7a8daf18> - IOError
565
+ Starting SSE heartbeat thread!
566
+ New SSE Client connected: #<StringIO:0x007fdd7a8d27c8>
567
+ Starting SSE heartbeat thread!
568
+ Starting SSE heartbeat thread!
569
+ New SSE Client connected: #<StringIO:0x007f882b4d9440>
570
+ Starting SSE heartbeat thread!
571
+ New SSE Client connected: #<StringIO:0x007f882b4d1510>
572
+ SSE Client disconnected: #<StringIO:0x007f882b4d1510> - IOError
573
+ Starting SSE heartbeat thread!
574
+ Starting SSE heartbeat thread!
575
+ New SSE Client connected: #<StringIO:0x007f882b4c1d18>
576
+ New SSE Client connected: #<StringIO:0x007f882b4c2420>
577
+ Starting SSE heartbeat thread!
578
+ New SSE Client connected: #<StringIO:0x007f882b4b9fa0>
579
+ Starting SSE heartbeat thread!
580
+ Starting SSE heartbeat thread!
581
+ New SSE Client connected: #<StringIO:0x007f882b4b0cc0>
582
+ Starting SSE heartbeat thread!
583
+ New SSE Client connected: #<StringIO:0x007f882b4a3250>
584
+ SSE Client disconnected: #<StringIO:0x007f882b4a3250> - IOError
585
+ Starting SSE heartbeat thread!
586
+ New SSE Client connected: #<StringIO:0x007f882b4a0550>
587
+ Starting SSE heartbeat thread!
588
+ Starting SSE heartbeat thread!
589
+ New SSE Client connected: #<StringIO:0x007f882b48b880>
590
+ Starting SSE heartbeat thread!
591
+ New SSE Client connected: #<StringIO:0x007f882b488630>
592
+ Starting SSE heartbeat thread!
593
+ Starting SSE heartbeat thread!
594
+ New SSE Client connected: #<StringIO:0x007fb5342ab728> - ["foo", "bar"]
595
+ Starting SSE heartbeat thread!
596
+ Starting SSE heartbeat thread!
597
+ New SSE Client connected: #<StringIO:0x007fb5342a1390> - []
598
+ Starting SSE heartbeat thread!
599
+ New SSE Client connected: #<StringIO:0x007fb534293c68> - []
600
+ Starting SSE heartbeat thread!
601
+ Starting SSE heartbeat thread!
602
+ New SSE Client connected: #<StringIO:0x007fb53428b1a8> - ["foo", "bar"]
603
+ Starting SSE heartbeat thread!
604
+ New SSE Client connected: #<StringIO:0x007fb534280d20> - []
605
+ SSE Client disconnected: #<StringIO:0x007fb534280d20> - IOError
606
+ Starting SSE heartbeat thread!
607
+ New SSE Client connected: #<StringIO:0x007fb534273aa8> - []
608
+ SSE Client disconnected: #<StringIO:0x007fb534273aa8> - IOError
609
+ Starting SSE heartbeat thread!
610
+ New SSE Client connected: #<StringIO:0x007fb534270830> - []
611
+ Starting SSE heartbeat thread!
612
+ Starting SSE heartbeat thread!
613
+ New SSE Client connected: #<StringIO:0x007fb534260098> - []
614
+ Starting SSE heartbeat thread!
615
+ New SSE Client connected: #<StringIO:0x007fb534253258> - []
616
+ New SSE Client connected: #<StringIO:0x007fb534253730> - ["foo", "bar"]
617
+ Starting SSE heartbeat thread!
618
+ Starting SSE heartbeat thread!
619
+ New SSE Client connected: #<StringIO:0x007fb80cd28ba8> - []
620
+ Starting SSE heartbeat thread!
621
+ Starting SSE heartbeat thread!
622
+ New SSE Client connected: #<StringIO:0x007ff734e5a438> - []
623
+ Starting SSE heartbeat thread!
624
+ New SSE Client connected: #<StringIO:0x007ff734bc8d28> - []
625
+ Starting SSE heartbeat thread!
626
+ Starting SSE heartbeat thread!
627
+ New SSE Client connected: #<StringIO:0x007f96c3c60fa0> - []
628
+ Starting SSE heartbeat thread!
629
+ Starting SSE heartbeat thread!
630
+ New SSE Client connected: #<StringIO:0x007fe95ce385d0> - []
631
+ Starting SSE heartbeat thread!
632
+ Starting SSE heartbeat thread!
633
+ New SSE Client connected: #<StringIO:0x007fd1b28335c0> - []
634
+ Starting SSE heartbeat thread!
635
+ Starting SSE heartbeat thread!
636
+ New SSE Client connected: #<StringIO:0x007fc71da2b480> - []
637
+ Starting SSE heartbeat thread!
638
+ Starting SSE heartbeat thread!
639
+ New SSE Client connected: #<StringIO:0x007fab73db98b0> - []
640
+ SSE Client disconnected: #<StringIO:0x007fab73db98b0> - IOError
641
+ Starting SSE heartbeat thread!
642
+ Starting SSE heartbeat thread!
643
+ New SSE Client connected: #<StringIO:0x007ff2d346a668> - []
644
+ SSE Client disconnected: #<StringIO:0x007ff2d346a668> - IOError
645
+ Starting SSE heartbeat thread!
646
+ Starting SSE heartbeat thread!
647
+ New SSE Client connected: #<StringIO:0x007ff26b230ea0> - []
648
+ SSE Client disconnected: #<StringIO:0x007ff26b230ea0> - IOError
649
+ Starting SSE heartbeat thread!
650
+ Starting SSE heartbeat thread!
651
+ New SSE Client connected: #<StringIO:0x007f8d837bc650> - []
652
+ Starting SSE heartbeat thread!
653
+ New SSE Client connected: #<StringIO:0x007f8d836fe768> - []
654
+ SSE Client disconnected: #<StringIO:0x007f8d836fe768> - IOError
655
+ Starting SSE heartbeat thread!
656
+ Starting SSE heartbeat thread!
657
+ New SSE Client connected: #<StringIO:0x007f8d83c36b68> - []
658
+ New SSE Client connected: #<StringIO:0x007f8d83c37130> - ["foo", "bar"]
659
+ Starting SSE heartbeat thread!
660
+ New SSE Client connected: #<StringIO:0x007f8d83becc20> - []
661
+ Starting SSE heartbeat thread!
662
+ New SSE Client connected: #<StringIO:0x007f8d82bf0880> - ["foo", "bar"]
663
+ Starting SSE heartbeat thread!
664
+ Starting SSE heartbeat thread!
665
+ New SSE Client connected: #<StringIO:0x007f8d83bcda50> - []
666
+ SSE Client disconnected: #<StringIO:0x007f8d83bcda50> - IOError
667
+ Starting SSE heartbeat thread!
668
+ New SSE Client connected: #<StringIO:0x007f8d823b68e0> - []
669
+ SSE Client disconnected: #<StringIO:0x007f8d823b68e0> - IOError
670
+ Starting SSE heartbeat thread!
671
+ New SSE Client connected: #<StringIO:0x007f8d83ba4da8> - []
672
+ Starting SSE heartbeat thread!
673
+ New SSE Client connected: #<StringIO:0x007f8d83347ca0> - []
674
+ Starting SSE heartbeat thread!
675
+ Starting SSE heartbeat thread!
676
+ New SSE Client connected: #<StringIO:0x007f8d82aa9210> - []
677
+ Starting SSE heartbeat thread!
678
+ New SSE Client connected: #<StringIO:0x007f8d82a116b8> - ["foo", "bar"]
679
+ Starting SSE heartbeat thread!
680
+ Starting SSE heartbeat thread!
681
+ New SSE Client connected: #<StringIO:0x007fb58bb042b0> - []
682
+ SSE Client disconnected: #<StringIO:0x007fb58bb042b0> - IOError
683
+ Starting SSE heartbeat thread!
684
+ Starting SSE heartbeat thread!
685
+ New SSE Client connected: #<StringIO:0x007fe70bb3bd58> - []
686
+ SSE Client disconnected: #<StringIO:0x007fe70bb3bd58> - IOError
687
+ Starting SSE heartbeat thread!
688
+ Starting SSE heartbeat thread!
689
+ New SSE Client connected: #<StringIO:0x007fb0c7133038> - []
690
+ Starting SSE heartbeat thread!
691
+ Starting SSE heartbeat thread!
692
+ New SSE Client connected: #<StringIO:0x007fb0c5bfbe90> - []
693
+ SSE Client disconnected: #<StringIO:0x007fb0c5bfbe90> - IOError
694
+ Starting SSE heartbeat thread!
695
+ Starting SSE heartbeat thread!
696
+ New SSE Client connected: #<StringIO:0x007fb0c589ac88> - []
697
+ Starting SSE heartbeat thread!
698
+ New SSE Client connected: #<StringIO:0x007fb0c58412f0> - []
699
+ New SSE Client connected: #<StringIO:0x007fb0c5841980> - ["foo", "bar"]
700
+ Starting SSE heartbeat thread!
701
+ New SSE Client connected: #<StringIO:0x007fb0c57824e0> - ["foo", "bar"]
702
+ Starting SSE heartbeat thread!
703
+ New SSE Client connected: #<StringIO:0x007fb0c55ea1f0> - []
704
+ SSE Client disconnected: #<StringIO:0x007fb0c55ea1f0> - IOError
705
+ Starting SSE heartbeat thread!
706
+ New SSE Client connected: #<StringIO:0x007fb0c5548e68> - []
707
+ Starting SSE heartbeat thread!
708
+ New SSE Client connected: #<StringIO:0x007fb0c53a3770> - []
709
+ SSE Client disconnected: #<StringIO:0x007fb0c53a3770> - IOError
710
+ Starting SSE heartbeat thread!
711
+ New SSE Client connected: #<StringIO:0x007fb0c53703c0> - []
712
+ Starting SSE heartbeat thread!
713
+ Starting SSE heartbeat thread!
714
+ New SSE Client connected: #<StringIO:0x007fb0c5291fa8> - []
715
+ Starting SSE heartbeat thread!
716
+ New SSE Client connected: #<StringIO:0x007fb0c5233228> - ["foo", "bar"]
717
+ Starting SSE heartbeat thread!
718
+ Starting SSE heartbeat thread!
719
+ Starting SSE heartbeat thread!
720
+ Starting SSE heartbeat thread!
721
+ New SSE Client connected: #<StringIO:0x007faef729b9b0> - []
722
+ New SSE Client connected: #<StringIO:0x007faef729be88> - ["foo", "bar"]
723
+ Starting SSE heartbeat thread!
724
+ New SSE Client connected: #<StringIO:0x007faef7298238> - []
725
+ Starting SSE heartbeat thread!
726
+ Starting SSE heartbeat thread!
727
+ New SSE Client connected: #<StringIO:0x007faef796a750> - ["foo", "bar"]
728
+ Starting SSE heartbeat thread!
729
+ New SSE Client connected: #<StringIO:0x007faef798a910> - []
730
+ SSE Client disconnected: #<StringIO:0x007faef798a910> - IOError
731
+ Starting SSE heartbeat thread!
732
+ Starting SSE heartbeat thread!
733
+ New SSE Client connected: #<StringIO:0x007faef72a0230> - []
734
+ SSE Client disconnected: #<StringIO:0x007faef72a0230> - IOError
735
+ Starting SSE heartbeat thread!
736
+ Starting SSE heartbeat thread!
737
+ New SSE Client connected: #<StringIO:0x007faef79c3b48> - []
738
+ Starting SSE heartbeat thread!
739
+ New SSE Client connected: #<StringIO:0x007faef79c1118> - []
740
+ Starting SSE heartbeat thread!
741
+ New SSE Client connected: #<StringIO:0x007faef79b21b8> - []
742
+ Starting SSE heartbeat thread!
743
+ New SSE Client connected: #<StringIO:0x007faef79e3f10> - ["foo", "bar"]
@@ -27,6 +27,7 @@ describe SseRailsEngine do
27
27
  SseRailsEngine.setup do |config|
28
28
  config.heartbeat_interval = 1.minute
29
29
  end
30
+
30
31
  SseRailsEngine.heartbeat_interval.must_equal 1.minute
31
32
  end
32
33
 
@@ -34,4 +35,8 @@ describe SseRailsEngine do
34
35
  SseRailsEngine.manager.expects(:send_event).once
35
36
  SseRailsEngine.send_event('name', 'foo')
36
37
  end
38
+
39
+ it 'adds an access-control-allow-origin header' do
40
+ SseRailsEngine::Connection.sse_header.must_include('Access-Control-Allow-Origin: https://example.org')
41
+ end
37
42
  end
@@ -46,14 +46,14 @@ describe SseRailsEngine::Manager do
46
46
  it 'writes string event to stream' do
47
47
  manager.register(env1)
48
48
  manager.send_event('foo', 'bar')
49
- env1['rack.hijack_io'].string.must_equal(SseRailsEngine::Connection::SSE_HEADER + "event: foo\ndata: bar\n\n")
49
+ env1['rack.hijack_io'].string.must_equal(SseRailsEngine::Connection.sse_header + "event: foo\ndata: bar\n\n")
50
50
  end
51
51
 
52
52
  it 'writes event object to stream' do
53
53
  manager.register(env1)
54
54
  manager.send_event('foo', a: 123, 'b' => 'abc', c: { foo: 'bar' })
55
55
  env1['rack.hijack_io'].string.must_equal(
56
- SseRailsEngine::Connection::SSE_HEADER +
56
+ SseRailsEngine::Connection.sse_header +
57
57
  "event: foo\ndata: {\"a\":123,\"b\":\"abc\",\"c\":{\"foo\":\"bar\"}}\n\n"
58
58
  )
59
59
  end
@@ -75,7 +75,7 @@ describe SseRailsEngine::Manager do
75
75
  manager.register(env1)
76
76
  manager.send_event('foo')
77
77
  env1['rack.hijack_io'].string.must_equal(
78
- SseRailsEngine::Connection::SSE_HEADER + "event: foo\ndata: \n\n", 'env1 should have received event')
78
+ SseRailsEngine::Connection.sse_header + "event: foo\ndata: \n\n", 'env1 should have received event')
79
79
  end
80
80
 
81
81
  it 'does not send events to clients that didnt register for them' do
@@ -83,7 +83,7 @@ describe SseRailsEngine::Manager do
83
83
  manager.register(env1)
84
84
  manager.send_event('test')
85
85
  env1['rack.hijack_io'].string.must_equal(
86
- SseRailsEngine::Connection::SSE_HEADER, 'env2 should not have received event')
86
+ SseRailsEngine::Connection.sse_header, 'env2 should not have received event')
87
87
  end
88
88
 
89
89
  it 'filters msgs depending on channels requested' do
@@ -92,8 +92,8 @@ describe SseRailsEngine::Manager do
92
92
  manager.register(env2)
93
93
  manager.send_event('test')
94
94
  env1['rack.hijack_io'].string.must_equal(
95
- SseRailsEngine::Connection::SSE_HEADER + "event: test\ndata: \n\n", 'env1 should have received event')
95
+ SseRailsEngine::Connection.sse_header + "event: test\ndata: \n\n", 'env1 should have received event')
96
96
  env2['rack.hijack_io'].string.must_equal(
97
- SseRailsEngine::Connection::SSE_HEADER, 'env2 should not have received event')
97
+ SseRailsEngine::Connection.sse_header, 'env2 should not have received event')
98
98
  end
99
99
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sse-rails-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Hender
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bump
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: hashie
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -104,6 +118,7 @@ files:
104
118
  - LICENSE
105
119
  - README.md
106
120
  - Rakefile
121
+ - config/initializers/headers.rb
107
122
  - config/initializers/sse_rails_engine.rb
108
123
  - config/routes.rb
109
124
  - lib/sse-rails-engine.rb
@@ -139,6 +154,7 @@ files:
139
154
  - test/dummy/config/locales/en.yml
140
155
  - test/dummy/config/routes.rb
141
156
  - test/dummy/config/secrets.yml
157
+ - test/dummy/log/test.log
142
158
  - test/dummy/public/404.html
143
159
  - test/dummy/public/422.html
144
160
  - test/dummy/public/500.html
@@ -198,6 +214,7 @@ test_files:
198
214
  - test/dummy/config/routes.rb
199
215
  - test/dummy/config/secrets.yml
200
216
  - test/dummy/config.ru
217
+ - test/dummy/log/test.log
201
218
  - test/dummy/public/404.html
202
219
  - test/dummy/public/422.html
203
220
  - test/dummy/public/500.html