em-worker 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/em-worker.gemspec +1 -1
- data/lib/em/worker.rb +1 -1
- data/spec/worker_spec.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce306120b70b91f7ac5ee3b90d4cedd4639a20ef
|
4
|
+
data.tar.gz: 6ca4a61d9e030d116981355536719ccb80d05763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f467d08f1fd1fede0680a67e5a1cc34be327c2edd9af31eeae3b87f294d13d62528241e5c369f1b9f03cb34941c97dc912f843ed815cdbed0c76f3ddd76c9dd
|
7
|
+
data.tar.gz: 821a5368b687c8472d5e4b9d193c3af557f9c77c1728aa542777fcdb0d63655ac7f3df06805314c08289130c9c5d69a45abc6f3c24259477ba566c81fdfc169d
|
data/README.md
CHANGED
data/em-worker.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "em-worker"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.2"
|
8
8
|
spec.authors = ["Sean Porter"]
|
9
9
|
spec.email = ["portertech@gmail.com"]
|
10
10
|
spec.description = "Provides a simple task worker, with a task concurrency limit."
|
data/lib/em/worker.rb
CHANGED
data/spec/worker_spec.rb
CHANGED
@@ -29,17 +29,17 @@ describe "EM::Worker" do
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
it "will do a maximum of
|
32
|
+
it "will do a maximum of 12 tasks at a time by default" do
|
33
33
|
@concurrency = Queue.new
|
34
34
|
async_wrapper do
|
35
|
-
|
35
|
+
24.times do
|
36
36
|
@worker.enqueue do
|
37
37
|
@concurrency << 1
|
38
38
|
sleep 1000
|
39
39
|
end
|
40
40
|
end
|
41
41
|
timer(1) do
|
42
|
-
@concurrency.size.should eql
|
42
|
+
@concurrency.size.should eql 12
|
43
43
|
async_done
|
44
44
|
end
|
45
45
|
end
|