diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-01-19 12:27:15 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-01-19 12:27:15 +0000 |
commit | 9a05949ea4d669cb192d3e1d04984e27b82b0a69 (patch) | |
tree | 1e6dadcb8baf8531f38d82b5fb2c33486c73829c /lib/custodian/queue.rb | |
parent | 7991f9a5ffc4d09209bf0431c188106a88cd8258 (diff) |
Updated to use our queue-abstraction.
This means we can queue/dequeue to either Redis or Beanstalkd.
Diffstat (limited to 'lib/custodian/queue.rb')
-rw-r--r-- | lib/custodian/queue.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/custodian/queue.rb b/lib/custodian/queue.rb index a6e062c..d1f2057 100644 --- a/lib/custodian/queue.rb +++ b/lib/custodian/queue.rb @@ -82,7 +82,11 @@ module Custodian # Fetch a job from the queue - the timeout parameter is ignored. # def fetch(timeout) - @redis.lpop( "queue" ) + job = false + while( ! job ) + job = @redis.lpop( "queue" ) + end + return( job ) end # |