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 | 178a15a7bdabceb375e82f95d51ceff0dc1e6a28 (patch) | |
tree | f01111de9cf1668404f95873b48fd1cf894ebe1c | |
parent | 843622bcdb0f52abf7c6f6655e070b7f15bccfe0 (diff) |
Minor formatting and commenting update.
-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) ) |