require 'revdispatch' # define this part in ruby to make sure other # ruby threads can execute while we waiting for a response module Evdispatch class Loop def response(id) while wait_for_response( id, 1, 0 ) res = response_for( id ) break if res end res = response_for( id ) unless res res end end end