class Async::Wrapper

def wait_for(duration)

def wait_for(duration)
	if @monitor
		@monitor.interests = interests
	else
		@monitor = @reactor.register(@io, interests, self)
	end
	
	# If the user requested an explicit timeout for this operation:
	if duration
		@reactor.timeout(duration) do
			begin
				Task.yield
			rescue Async::TimeoutError
				return false
			end
		end
	else
		Task.yield
	end
	
	return true
end