geemus/excon — pull request #337 by burns (2013-11-26 23:54:44+00:00)
Title: add :persistent option

This will need some README updates before merging.
But I wanted to ask if you still want to make this non-persistent by default?
It seems to make sense for it to be persistent by default, being a HTTP/1.1 client.

Fog is and still would be non-persistent by default.
Those changes would look like this:

```diff
def initialize(url, persistent=false, params={})
unless params.has_key?(:debug_response)
params[:debug_response] = true
end
params[:headers] ||= {}
params[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}"
+ params.merge!(:persistent => params.fetch(:persistent, persistent))
@excon = Excon.new(url, params)
- @persistent = persistent
end

def request(params, &block)
- reset unless @persistent
@excon.request(params, &block)
end
```
This would allow a `:persistent` option in `:connection_options` to override the provider's `:persistent` option.

re: #276