lib/isomorfeus/transport.rb in isomorfeus-transport-1.0.0.zeta3 vs lib/isomorfeus/transport.rb in isomorfeus-transport-1.0.0.zeta4

- old
+ new

@@ -110,12 +110,12 @@ agent = Isomorfeus::Transport::RequestAgent.new(request) register_request_in_progress(request, agent.id) raise 'No socket!' unless @socket @socket.send(`JSON.stringify(#{{subscribe: { agent_ids: { agent.id => request }}}.to_n})`) end - result_promise = agent.promise.then do |response| - response[:agent_response] + result_promise = agent.promise.then do |agent| + agent.response end if block_given? result_promise = result_promise.then do |response| block.call(response) end @@ -131,11 +131,11 @@ agent = Isomorfeus::Transport::RequestAgent.new(request) register_request_in_progress(request, agent.id) raise 'No socket!' unless @socket @socket.send(`JSON.stringify(#{{unsubscribe: { agent_ids: { agent.id => request }}}.to_n})`) end - result_promise = agent.promise.then do |response| - response[:agent_response] + result_promise = agent.promise.then do |agent| + agent.response end if block_given? result_promise = result_promise.then do |response| block.call(response) end \ No newline at end of file