# File lib/brb/tunnel/shared.rb, line 49 def receive_data(data) @buffer << data while obj = load_request if obj[0] == BrB::Request::ReturnCode # Return if we have a callback handling the return : next if treat_callback_return(obj[1], obj[2], obj[3]) # No callback, so blocking thread is waiting : @replock.lock @responses[obj[2]] ||= Queue.new @replock.unlock @responses[obj[2]] << [obj[1], obj[3]] else @queue << obj EM.defer do treat_request(@queue.pop) end end end end