class Async::Scheduler
def initialize(parent = nil, selector: nil, worker_pool: DEFAULT_WORKER_POOL)
@parameter parent [Node | Nil] The parent node to use for task hierarchy.
@public Since *Async v1*.
Create a new scheduler.
def initialize(parent = nil, selector: nil, worker_pool: DEFAULT_WORKER_POOL) super(parent) @selector = selector || ::IO::Event::Selector.new(Fiber.current) @interrupted = false @blocked = 0 @busy_time = 0.0 @idle_time = 0.0 @timers = ::IO::Event::Timers.new if worker_pool == true @worker_pool = WorkerPool.new else @worker_pool = worker_pool end if @worker_pool self.singleton_class.prepend(WorkerPool::BlockingOperationWait) end end