From 178a15a7bdabceb375e82f95d51ceff0dc1e6a28 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 18 Feb 2015 04:28:10 +0000 Subject: Minor formatting and commenting update. --- lib/custodian/queue.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/custodian/queue.rb b/lib/custodian/queue.rb index c48bba3..1ef9c61 100644 --- a/lib/custodian/queue.rb +++ b/lib/custodian/queue.rb @@ -58,6 +58,7 @@ module Custodian raise "Subclasses must implement this method!" end + # # Empty the queue # @@ -102,6 +103,7 @@ end end end + # # Add a new job to the queue. # @@ -117,6 +119,10 @@ end @redis.llen( "queue" ) end + + # + # Empty the queue, discarding all pending jobs. + # def flush! @redis.del( "queue" ) end @@ -138,6 +144,7 @@ end @queue = Beanstalk::Pool.new( ["#{host}:11300" ] ) end + # # Here we fetch a value from the queue, and delete it at the same time. # @@ -175,8 +182,9 @@ end ( stats['current-jobs-ready'] || 0 ) end + # - # Flush the queue. + # Flush the queue, discarding all pending jobs. # def flush! while( fetch(1) ) -- cgit v1.2.1