Module: Isomorfeus::SSR

Defined in:
lib/isomorfeus/preact/ssr/render_core.rb

Class Method Summary collapse

Class Method Details

.disconnect_transportObject



107
108
109
110
111
112
113
114
115
# File 'lib/isomorfeus/preact/ssr/render_core.rb', line 107

def self.disconnect_transport
  while Isomorfeus::Transport::RequestAgent.agents.size > 0
    agent_id, agent = Isomorfeus::Transport::RequestAgent.agents.first
    agent.promise.reject() unless agent.promise.realized?
    Isomorfeus::Transport::RequestAgent.del!(agent_id)
  end
  Isomorfeus::Transport.instance_variable_set(:@requests_in_progress, { requests: {}, agent_ids: {} })
  Isomorfeus::Transport.disconnect
end