class Async::Task
def stop
-
(void)
-
def stop if self.stopping? # If we are already stopping this task... don't try to stop it again. return true elsif self.running? @status = :stopping if self.current? raise Stop, "Stopping current fiber!" elsif @fiber.alive? @fiber.resume(Stop.new) end end ensure @children&.each(&:stop) end