lib/workers/scheduler.rb in workers-0.0.3 vs lib/workers/scheduler.rb in workers-0.0.4
- old
+ new
@@ -1,8 +1,11 @@
module Workers
class Scheduler
+ include Workers::Helpers
+
def initialize(options = {})
+ @logger = Workers::LogProxy.new(options[:logger])
@pool = options[:pool] || Workers::Pool.new
@schedule = SortedSet.new
@mutex = Mutex.new
@thread = Thread.new { start_loop }
end
@@ -37,9 +40,13 @@
@pool.join
@thread.kill
end
return nil
+ end
+
+ def alive?
+ return @thread && @thread.alive?
end
private
def start_loop