simplews 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/simplews/jobs.rb +5 -1
  2. metadata +2 -2
data/lib/simplews/jobs.rb CHANGED
@@ -34,6 +34,10 @@ class SimpleWS::Jobs < SimpleWS
34
34
  @@queue = []
35
35
  @@max_jobs = 3
36
36
 
37
+ def self.queue_size(size)
38
+ @@max_jobs = size
39
+ end
40
+
37
41
 
38
42
  def self.random_name(s="", num=20)
39
43
  num.times{
@@ -87,7 +91,7 @@ class SimpleWS::Jobs < SimpleWS
87
91
  end
88
92
 
89
93
  def self.dequeue
90
- if @@pids.length <= @@max_jobs && @@queue.any?
94
+ if @@pids.length < @@max_jobs && @@queue.any?
91
95
  job_info = @@queue.pop
92
96
 
93
97
  pid = Job.new.run(job_info[:task], job_info[:name], @@task_results[job_info[:task]], *job_info[:args])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplews
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-15 00:00:00 +01:00
12
+ date: 2010-02-16 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency