class Async::Idler

def wait

If the scheduler is overloaded, this method will sleep for an exponentially increasing amount of time.

Wait until the system is idle, according to the maximum load specified.
def wait
	scheduler = Fiber.scheduler
	backoff = nil
	
	while true
		load = scheduler.load
		
		break if load < @maximum_load
		
		if backoff
			sleep(backoff)
			backoff *= 2.0
		else
			scheduler.yield
			backoff = @backoff
		end
	end
end