diff options
| author | Steve Kemp <steve@steve.org.uk> | 2015-02-18 04:28:10 +0000 | 
|---|---|---|
| committer | Steve Kemp <steve@steve.org.uk> | 2015-02-18 04:28:10 +0000 | 
| commit | ce925462491ec1abf87fcd6448563d873b90ae22 (patch) | |
| tree | 9cdd178993f28d3f815cb1563143890bbd455e4b /lib | |
| parent | 375f88d3bba036a6b6555fbf9f6d5b45626ba1d1 (diff) | |
Minor formatting and commenting update.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/custodian/queue.rb | 10 | 
1 files changed, 9 insertions, 1 deletions
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) )  | 
