Sha256: 50fe8e5e154396b1cc468ee1c2461b05fd01b983170cee07e035687dbf43aea2
Contents?: true
Size: 1.05 KB
Versions: 20
Compression:
Stored size: 1.05 KB
Contents
module Isomorfeus module Transport class ClientProcessor def self.process(json_hash) if json_hash.key?(:response) process_response(json_hash) elsif json_hash.key?(:notification) process_notification(json_hash) end end def self.process_notification(notification_hash) processor_class = "::#{notification_hash[:notification][:class]}".constantize processor_class.process_message(notification_hash[:notification][:channel], notification_hash[:notification][:message]) end def self.process_response(response_hash) response_hash[:response][:agent_ids].keys.each do |agent_id| agent = Isomorfeus::Transport::RequestAgent.get!(agent_id) Isomorfeus::Transport.unregister_request_in_progress(agent_id) unless agent.promise.realized? agent.full_response = response_hash agent.response = response_hash[:response][:agent_ids][agent_id] agent.promise.resolve(agent) end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems