summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-02-18 04:28:10 +0000
committerSteve Kemp <steve@steve.org.uk>2015-02-18 04:28:10 +0000
commitce925462491ec1abf87fcd6448563d873b90ae22 (patch)
tree9cdd178993f28d3f815cb1563143890bbd455e4b
parent375f88d3bba036a6b6555fbf9f6d5b45626ba1d1 (diff)
Minor formatting and commenting update.
-rw-r--r--lib/custodian/queue.rb10
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) )