class Async::Scheduler

def self.supported?

def self.supported?
	true
end

def self.supported?

def self.supported?
	false
end

def block(blocker, timeout)

def block(blocker, timeout)
	@reactor.block(blocker, timeout)
end

def clear!

def clear!
	# Because these instances are created with `autoclose: false`, this does not close the underlying file descriptor:
	# @ios&.each_value(&:close)
	
	@wrappers = nil
	Fiber.set_scheduler(nil)
end

def close

def close
end

def fiber(&block)

def fiber(&block)
	task = Task.new(&block)
	
	task.resume
	
	return task.fiber
end

def from_io(io)

def from_io(io)
rs[io] ||= Wrapper.new(io, @reactor)

def initialize(reactor)

def initialize(reactor)
	@reactor = reactor
	@wrappers = nil
end

def io_wait(io, events, timeout = nil)

def io_wait(io, events, timeout = nil)
	wrapper = from_io(io)
	
	if events == ::IO::READABLE
		if wrapper.wait_readable(timeout)
			return ::IO::READABLE
		end
	elsif events == ::IO::WRITABLE
		if wrapper.wait_writable(timeout)
			return ::IO::WRITABLE
		end
	else
		if wrapper.wait_any(timeout)
			return events
		end
	end
	
	return false
ensure
	wrapper.reactor = nil
end

def kernel_sleep(duration)

def kernel_sleep(duration)
	@reactor.sleep(duration)
end

def process_wait(pid, flags)

@returns [Process::Status] A process status instance.
@parameter flags [Integer] A bit-mask of flags suitable for `Process::Status.wait`.
@parameter pid [Integer] The process ID to wait for.
Wait for the specified process ID to exit.
def process_wait(pid, flags)
	Thread.new do
		Process::Status.wait(pid, flags)
	end.value
end

def set!

def set!
	@wrappers = {}
	Fiber.set_scheduler(self)
end

def unblock(blocker, fiber)

def unblock(blocker, fiber)
	@reactor.unblock(blocker, fiber)
end