Class EventMachine::Protocols::HttpClient
In: lib/protocols/httpclient.rb
Parent: Connection

Methods

Included Modules

EventMachine::Deferrable

Constants

MaxPostContentLength = 20 * 1024 * 1024

Public Class methods

TODO: Add streaming so we can support enormous POSTs. Current max is 20meg. Timeout for connections that run too long or hang somewhere in the middle. Persistent connections (HTTP/1.1), may need a associated delegate object. DNS: Some way to cache DNS lookups for hostnames we connect to. Ruby‘s DNS lookups are unbelievably slow. HEAD requests. Chunked transfer encoding. Convenience methods for requests. get, post, url, etc. SSL. Handle status codes like 304, 100, etc. Refactor this code so that protocol errors all get handled one way (an exception?), instead of sprinkling set_deferred_status :failed calls everywhere.

Public Instance methods

We send the request when we get a connection. AND, we set an instance variable to indicate we passed through here. That allows unbind to know whether there was a successful connection. NB: This naive technique won‘t work when we have to support multiple requests on a single connection.

[Validate]