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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36c1f745c922f5642586de1dd655903c00d83f3f
4
- data.tar.gz: 6f324eeba738f4206a671871cc2fd441fd50f716
3
+ metadata.gz: ce306120b70b91f7ac5ee3b90d4cedd4639a20ef
4
+ data.tar.gz: 6ca4a61d9e030d116981355536719ccb80d05763
5
5
  SHA512:
6
- metadata.gz: 46995ca518615c9ce85a31508e6e17acf3fd2631fad36825ce257cfa9056522a39a55ad47484fe2fbe2ca4dbe36db1f0fd42360b4676a224f1f35fccb6b43928
7
- data.tar.gz: 343abd0e38f47c5f6153b7f7b642a5455b8cabc46d17e4a0cbd01a2387d457f6a9b88fe42d22f31e1eedde4c19cf7fc655a8ae9f89a33f7c9328680d48ecab40
6
+ metadata.gz: 3f467d08f1fd1fede0680a67e5a1cc34be327c2edd9af31eeae3b87f294d13d62528241e5c369f1b9f03cb34941c97dc912f843ed815cdbed0c76f3ddd76c9dd
7
+ data.tar.gz: 821a5368b687c8472d5e4b9d193c3af557f9c77c1728aa542777fcdb0d63655ac7f3df06805314c08289130c9c5d69a45abc6f3c24259477ba566c81fdfc169d
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ``` ruby
24
- @worker = EM::Worker.new(:concurrency => 12) # defaults to 10
24
+ @worker = EM::Worker.new(:concurrency => 16) # defaults to 12
25
25
 
26
26
  @worker.enqueue do
27
27
  puts "winning"
@@ -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.1"
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."
@@ -4,7 +4,7 @@ module EM
4
4
  class Worker
5
5
  def initialize(options={})
6
6
  @task_queue = EM::Queue.new
7
- @concurrency = options.fetch(:concurrency, 10)
7
+ @concurrency = options.fetch(:concurrency, 12)
8
8
  start
9
9
  end
10
10
 
@@ -29,17 +29,17 @@ describe "EM::Worker" do
29
29
  end
30
30
  end
31
31
 
32
- it "will do a maximum of 10 tasks at a time by default" do
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
- 20.times do
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 10
42
+ @concurrency.size.should eql 12
43
43
  async_done
44
44
  end
45
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter