sinatra-cometio 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/sinatra-cometio/application.rb +12 -2
- data/lib/sinatra-cometio/version.rb +1 -1
- data/sample/Gemfile +1 -0
- data/sample/Gemfile.lock +2 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -64,8 +64,18 @@ module Sinatra::CometIO
|
|
64
64
|
type = params[:type]
|
65
65
|
data = params[:data]
|
66
66
|
from = params[:session]
|
67
|
-
|
68
|
-
|
67
|
+
EM::defer do
|
68
|
+
CometIO.emit type, data, from unless type.to_s.empty?
|
69
|
+
end
|
70
|
+
stream :keep_open do |s|
|
71
|
+
begin
|
72
|
+
s.write({:session => from, :type => type, :data => data}.to_json)
|
73
|
+
s.flush
|
74
|
+
s.close
|
75
|
+
rescue
|
76
|
+
s.close
|
77
|
+
end
|
78
|
+
end
|
69
79
|
end
|
70
80
|
|
71
81
|
end
|
data/sample/Gemfile
CHANGED
data/sample/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
backports (3.
|
4
|
+
backports (3.0.3)
|
5
5
|
daemons (1.1.9)
|
6
6
|
event_emitter (0.2.3)
|
7
7
|
eventmachine (1.0.1)
|
@@ -43,6 +43,7 @@ PLATFORMS
|
|
43
43
|
ruby
|
44
44
|
|
45
45
|
DEPENDENCIES
|
46
|
+
backports (< 3.1.0)
|
46
47
|
event_emitter
|
47
48
|
foreman
|
48
49
|
haml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-cometio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|