summaryrefslogtreecommitdiff
path: root/lib/custodian/queue.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-01-19 12:27:15 +0000
committerSteve Kemp <steve@steve.org.uk>2015-01-19 12:27:15 +0000
commit7d90bf7fba34d586c25ed096b8a2fc0fdf311879 (patch)
tree006a0737b075effa6b526bd3ff96a3b30167aa54 /lib/custodian/queue.rb
parentca9be00dc45d0a71210ad16423d6d319c87b6727 (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.rb6
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
#