Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adapter for the HTTP.rb gem #591

Closed
wants to merge 4 commits into from
Closed

Add adapter for the HTTP.rb gem #591

wants to merge 4 commits into from

Conversation

jhbabon
Copy link

@jhbabon jhbabon commented Jun 10, 2016

The gem link: https://rubygems.org/gems/http

You can initialize the adapter with any of the options that the gem allows:

Faraday.new do |faraday|
  faraday.adapter :http, :keep_alive_timeout => 10
end

I know there is a PR trying to do something similar (#564) but is kind of stuck and is using and old version of the http gem, so I decided to try my adapter. Feel free to close this PR if you want to push the other one and sorry if is bothering someone.

About the stack trace in the specs, I opened a PR for the http gem as well to see if it can be fixed. I think there is nothing we can do in the Faraday side. This is the PR: httprb/http#353

The gem link: https://rubygems.org/gems/http

You can initialize the adapter with any of the options
that the gem allows

Examples

  Faraday.new do |faraday|
    faraday.adapter :http, :keep_alive_timeout => 10
  end
Since there is now a new adapter, it means that is going to add more
code, and some parts of that code are not going to be tested when
the SSL options is not set. That means that is going to be less
coverage during non SSL tests.
Fallback for instace vars syntax.
@iMacTia
Copy link
Member

iMacTia commented Oct 11, 2016

@jhbabon I can see the PR on http was merged, can you update your branch to make tests passing?
Also, for completeness, here is the requirements for new adapters.
Please double-check you followed all of them:

We will accept adapters that:

  • support SSL & streaming;
  • are proven and may have better performance than existing ones; or
  • if they have features not present in included adapters.

@mislav, @technoweenie, this would be a new adapter so is probably better if you review it.

@technoweenie
Copy link
Member

I think this would work better as a faraday-http gem. We can provide access to a repo on the lostisland account for that. Ideally, Faraday maintainers shouldn't have to maintain compatibility with all the various HTTP ruby gems. This also gives adapter contributors more freedom over their own adapters.

I realize that Faraday depends on plenty of gems today. Some plans in a completely rewritten Faraday 1.0 and separate Hurley gem included supporting only the core net/http adapter.

@iMacTia
Copy link
Member

iMacTia commented Oct 21, 2016

Hi @jhbabon I just want to update you on the situation.
We're currently in the process of drawing Faraday's next big release 1.0 (#620).
One of the things we're discussing is how to deal with new adapters proposals as the more we support inside Faraday, the more work we have to do in order to support new features in the future, so we need to plan this carefully.

I appreciate your patience. In the meantime, you can update your branch with the latest ruby-http gem version including your fix.

@jhbabon
Copy link
Author

jhbabon commented Oct 26, 2016

Hi @iMacTia!

Thanks for the all the explanations. I think is better to close this PR because right now I can't confirm that this adapter has the same or more of the features other adapters have, specially the streaming part. Also, moving this to a separate gem once the version 1.0 of Faraday is released makes total sense. I'll wait until then and if I have time I'll try to take a look at this again.

Thanks for your patience.

@jhbabon jhbabon closed this Oct 26, 2016
@iMacTia
Copy link
Member

iMacTia commented Oct 26, 2016

Thank you for your understanding!
I really hope this will see the light in the future as there are some people requesting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants