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 | 7d90bf7fba34d586c25ed096b8a2fc0fdf311879 (patch) | |
tree | 006a0737b075effa6b526bd3ff96a3b30167aa54 /lib/custodian/queue.rb | |
parent | ca9be00dc45d0a71210ad16423d6d319c87b6727 (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 # |