From 9a05949ea4d669cb192d3e1d04984e27b82b0a69 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 19 Jan 2015 12:27:15 +0000 Subject: Updated to use our queue-abstraction. This means we can queue/dequeue to either Redis or Beanstalkd. --- lib/custodian/queue.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/custodian/queue.rb') 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 # -- cgit v1.2.1