sinatra-rocketio-linda 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/README.md +2 -3
- data/lib/sinatra/rocketio/linda/client.rb +12 -5
- data/lib/sinatra/rocketio/linda/version.rb +1 -1
- data/sample/bin/cui_calc_watcher.rb +1 -2
- data/sample/bin/cui_calc_worker.rb +4 -1
- 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: 078d94db2541cb4f0725832183ea614aaedd0b04
|
4
|
+
data.tar.gz: 818d263f79220681155b57bb1406f94165b1c9bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42405ce2bd52ebd099b8c3282a9e63263a758275d99aea15b45188e2f9087f3da3955d4526c230626b16edf80dd882982c587bb372702340bafe0034f865b983
|
7
|
+
data.tar.gz: e6e7c83e110f747536ae8687961bc5d890f18b5c79405b2b070a864d90492e7aebfa6295293ecaee487b38fb123ca09d07e2e19755cc9c8de82fe25792892280
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
sinatra-rocketio-linda
|
2
2
|
======================
|
3
3
|
|
4
|
-
* Linda implementation on Sinatra::RocketIO
|
4
|
+
* [Linda](https://github.com/shokai/linda-ruby) implementation on [Sinatra::RocketIO](https://github.com/shokai/sinatra-rocketio)
|
5
5
|
* https://github.com/shokai/sinatra-rocketio-linda
|
6
6
|
|
7
7
|
|
@@ -143,8 +143,7 @@ linda.io.on :connect do ## RocketIO's "connect" event
|
|
143
143
|
calc.call
|
144
144
|
end
|
145
145
|
|
146
|
-
|
147
|
-
end
|
146
|
+
linda.wait
|
148
147
|
```
|
149
148
|
|
150
149
|
|
@@ -7,17 +7,24 @@ module Sinatra
|
|
7
7
|
|
8
8
|
class Client
|
9
9
|
attr_reader :io, :tuplespace
|
10
|
-
def initialize(
|
11
|
-
if
|
12
|
-
@io = Sinatra::RocketIO::Client.new(
|
13
|
-
elsif
|
14
|
-
@io =
|
10
|
+
def initialize(io_or_url)
|
11
|
+
if io_or_url.kind_of? String and io_or_url =~ /^https?:\/\/.+$/
|
12
|
+
@io = Sinatra::RocketIO::Client.new(io_or_url).connect
|
13
|
+
elsif io_or_url.kind_of? ::Sinatra::RocketIO::Client
|
14
|
+
@io = io_or_url
|
15
15
|
else
|
16
16
|
raise ArgumentError, "argument must be URL or RocketIO::Client"
|
17
17
|
end
|
18
18
|
@tuplespace = Hash.new{|h,k|
|
19
19
|
h[k] = Sinatra::RocketIO::Linda::Client::TupleSpace.new(k, self)
|
20
20
|
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def wait(&block)
|
24
|
+
loop do
|
25
|
+
sleep 1
|
26
|
+
yield if block_given?
|
27
|
+
end
|
21
28
|
end
|
22
29
|
|
23
30
|
class TupleSpace
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-rocketio-linda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|