job_queue 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 9
2
+ :patch: 10
3
3
  :major: 0
4
4
  :minor: 0
@@ -63,7 +63,7 @@ class JobQueue::BeanstalkAdapter
63
63
  end
64
64
 
65
65
  def queue_length(queue)
66
- beanstalk_pool.stats_tube(queue)["total-jobs"]
66
+ beanstalk_pool.stats_tube(queue)["current-jobs-ready"]
67
67
  rescue Beanstalk::NotFoundError
68
68
  0
69
69
  end
@@ -58,5 +58,9 @@ shared_examples_for "JobQueue adapter queue length" do
58
58
  JobQueue.queue_length('test').should == 0
59
59
  5.times { JobQueue.put("hello", :queue => "test") }
60
60
  JobQueue.queue_length('test').should == 5
61
+ JobQueue.subscribe(:queue => "test") do |job|
62
+ throw :stop
63
+ end
64
+ JobQueue.queue_length('test').should == 4
61
65
  end
62
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martyn Loughran