Method: EventMachine::Protocols::HttpClient2#unbind

Defined in:
lib/em/protocols/httpclient2.rb

#unbindObject

– All pending requests, if any, must fail. We might come here without ever passing through connection_completed in case we can’t connect to the server. We’ll also get here when the connection closes (either because the server closes it, or we close it due to detecting an internal error or security violation). In either case, run down all pending requests, if any, and signal failure on them.

Set and remember a flag (@closed) so we can immediately fail any subsequent requests.



327
328
329
330
331
# File 'lib/em/protocols/httpclient2.rb', line 327

def unbind
  super
  @closed = true
  (@requests || []).each {|r| r.fail}
end