class Async::Task
def schedule(&block)
def schedule(&block) @fiber = Fiber.new(annotation: self.annotation) do begin completed!(yield) rescue Stop stopped! rescue StandardError => error failed!(error) rescue Exception => exception failed!(exception) # This is a critical failure, we should stop the reactor: raise ensure # Console.info(self) {"Task ensure $! = #{$!} with #{@children&.size.inspect} children!"} finish! end end @fiber.async_task = self self.root.resume(@fiber) end