class Async::Scheduler

def scheduler_close

Executes the run loop until all tasks are finished, then closes the scheduler.

Invoked when the fiber scheduler is being closed.
def scheduler_close
	# If the execution context (thread) was handling an exception, we want to exit as quickly as possible:
	unless $!
		self.run
	end
ensure
	self.close
end