Class: UberS3::Connection::EmHttpFibered

Inherits:
Adapter
  • Object
show all
Defined in:
lib/uber-s3/connection/em_http_fibered.rb

Instance Attribute Summary

Attributes inherited from Adapter

#access_key, #client, #defaults, #persistent, #secret_access_key

Instance Method Summary collapse

Methods inherited from Adapter

#initialize

Constructor Details

This class inherits a constructor from UberS3::Connection::Adapter

Instance Method Details

#request(verb, url, headers = {}, body = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/uber-s3/connection/em_http_fibered.rb', line 9

def request(verb, url, headers={}, body=nil)
  params = {}
  params[:head] = headers
  params[:body] = body if body
  # params[:keepalive] = true if persistent # causing issues ...?
    
  r = EM::HttpRequest.new(url).send(verb, params)

  UberS3::Response.new({
    :status => r.response_header.status,
    :header => r.response_header,
    :body   => r.response,
    :raw    => r
  })
end