rasti-web 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rasti/web/channel.rb +1 -1
- data/lib/rasti/web/version.rb +1 -1
- data/spec/streaming_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec9566c3c8cf96790406973506e6d9322ec10bc2
|
4
|
+
data.tar.gz: 25e1535210a4212bb3733281376cfc7b2f3384ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0f0f7cdbc4ddc35f0a8638c9537507b13622e41fc792104d4e4275ac8a366b9460cddb8b50d892626bce440546411b3663e89af1b064a2e2143bd9821d7d383
|
7
|
+
data.tar.gz: 069d05769cb012f2b3f987f1317570a429951c9713eae3c1c37ad1b2928f00b357cf08c5df48680fc30f620190273470af33bfbde2f2fa918019c5f53637b72a
|
data/lib/rasti/web/channel.rb
CHANGED
data/lib/rasti/web/version.rb
CHANGED
data/spec/streaming_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe 'Straming' do
|
|
7
7
|
let(:render) { Rasti::Web::Render.new request, response }
|
8
8
|
|
9
9
|
it 'Server sent events' do
|
10
|
-
render.server_sent_events :
|
10
|
+
render.server_sent_events :channel_1
|
11
11
|
|
12
12
|
response.status.must_equal 200
|
13
13
|
response['Content-Type'].must_equal 'text/event-stream'
|
@@ -20,13 +20,15 @@ describe 'Straming' do
|
|
20
20
|
response.body.each { |e| events << e }
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
channel_1 = Rasti::Web::Channel[:channel_1]
|
24
|
+
channel_2 = Rasti::Web::Channel[:channel_2]
|
24
25
|
sleep 0.05 # Wait for establish connection
|
25
26
|
|
26
27
|
3.times do |i|
|
27
28
|
data = {text: "Tick #{i}"}
|
28
29
|
event = Rasti::Web::ServerSentEvent.new data, id: i, event: 'tick'
|
29
|
-
|
30
|
+
channel_1.publish event
|
31
|
+
channel_2.publish event
|
30
32
|
end
|
31
33
|
|
32
34
|
Timeout.timeout(3) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasti-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|