celluloid-websocket 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/message_counter.ru +5 -0
- data/lib/celluloid/websocket.rb +2 -2
- data/lib/celluloid/websocket/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 973933734b0a34b492bc5affd799c4b875cd98f5
|
4
|
+
data.tar.gz: 2470866509815040e3042a19e481d30070a314b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c24abdd5f17a406c4256894e40343ba56e96d42cadd750953882b49dbc47af3b88d09d59ada447425612880a8a6674bcaa3c2f1d8533b8ec32b494354fdfc751
|
7
|
+
data.tar.gz: 98ceb533660de7b25e2e363d065c7cd10448a08d6896c78bcbb1cf07cdcd1a2dcbc2644b634fb5e57875b1d66f622063cb7088ad23b9f835b08f216ec1e0f21e
|
data/examples/message_counter.ru
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'celluloid/websocket/rack'
|
2
2
|
|
3
3
|
class WebSocketEcho < Celluloid::WebSocket
|
4
|
+
include Celluloid::Logger
|
5
|
+
|
4
6
|
def on_open
|
5
7
|
@counter = 0
|
6
8
|
while(true)
|
@@ -9,6 +11,9 @@ class WebSocketEcho < Celluloid::WebSocket
|
|
9
11
|
@counter += 1
|
10
12
|
write("#{@counter}: #{message}")
|
11
13
|
end
|
14
|
+
rescue => e
|
15
|
+
info "Exiting because: #{e.message}"
|
16
|
+
close
|
12
17
|
end
|
13
18
|
|
14
19
|
def on_error(*args)
|
data/lib/celluloid/websocket.rb
CHANGED
@@ -55,7 +55,7 @@ module Celluloid
|
|
55
55
|
alias_method :<<, :write
|
56
56
|
|
57
57
|
def close
|
58
|
-
@driver.close unless @driver.nil?
|
58
|
+
@driver.close unless @driver.nil?
|
59
59
|
@socket.close unless @socket.nil? || @socket.closed?
|
60
60
|
end
|
61
61
|
|
@@ -105,4 +105,4 @@ module Celluloid
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
108
|
-
end
|
108
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tinco Andringa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -151,3 +151,4 @@ signing_key:
|
|
151
151
|
specification_version: 4
|
152
152
|
summary: This is basically a small wrapper around Tony Arcieri's Reel::Websocket class.
|
153
153
|
test_files: []
|
154
|
+
has_rdoc:
|