lib/openwfe/util/workqueue.rb in openwferu-0.9.11 vs lib/openwfe/util/workqueue.rb in openwferu-0.9.12
- old
+ new
@@ -56,11 +56,11 @@
@workqueue_mutex = Mutex.new
@workqueue = []
@workqueue_frequency = 0
- OpenWFE::call_in_thread "expression_pool", self do
+ OpenWFE::call_in_thread "workqueue", self do
while true
break if @workqueue_frequency == nil
sleep @workqueue_frequency
do_process_workqueue
end
@@ -79,10 +79,12 @@
# Stops the workqueue.
#
def stop_workqueue
@workqueue_frequency = nil
do_process_workqueue
+ #
+ # maybe could process the work queue until it's really empty
end
#
# the method called by the mixer to actually queue the work.
#
@@ -139,15 +141,20 @@
end
#ldebug { "do_process_workqueue() #{q.size} items to process" }
q.each do |elt|
-
+
do_process_workelement elt
#
# exception management is now done in the
# do_process_workelement method
end
+
+ #
+ # TODO : have a pool of workers handle that
+
+ #q.size
end
protected
#