lostisland/faraday — pull request #378 by janko-m (2014-05-20 23:41:22+00:00)
Title: Fix response not changing with parallel requests

If we're doing parallel requests, and we're using for example `FaradayMiddleware::ParseJson`, then the responses' body would not be JSON-parsed.

```ruby
require "faraday"
require "typhoeus/adapters/faraday"

connection = Faraday.new(url) do |b|
b.response :json
b.adapter :typhoeus
end
```

response = nil

connection.in_parallel do
response = connection.get "/path"
end

response.body # JSON in string format
```

This is because response's `@env` would not be changed by the "on complete" callbacks, since `#finish` only changes the local `env`, and only after we initialized `@env`.