Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Switch from homebrewed HTTPService to Faraday? #99

Closed
arsduo opened this Issue · 7 comments

4 participants

@arsduo
Owner

We're considering switching Koala to Faraday, "an HTTP client lib that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle." You'd be able to set your app up to use Faraday's Net::HTTP adapter (including specifying your SSL configuration), and Koala would then automatically use all of that.

That would achieve two goals at once -- it would get us out of the business of choosing which HTTP libraries to support (and of supporting them) and it would give you more and more consistent control over how requests are made. Of course, this comes at the price of requiring a new dependency and making people learn how to set up Faraday inside their apps.

Any thoughts/concerns would be welcome in the comments.

@arsduo arsduo was assigned
@joshk

DO IT! you know you wanna! ;)

@joshk

Also, there is no learning curve for 99% of devs, its only the 1% who want to change the adapter. As long as you have good docs I don't see this being an issue :)

@arsduo
Owner

We'll definitely add this to the docs -- how and where to set up Faraday to be the equivalent for our two current adapters, how to set SSL settings, etc.

I think it's a clear win, but I also don't want it to be a big surprise :)

@rjacoby

+1. Seems like there are a lot of ppl with libcurl issues (altho I still recommend Anything But Net:HTTP). This would also move all the OpenSSL misconfig issues over to someone else's Issues list. ;-)

@aselder

+1

@arsduo
Owner

This is now completed in the v1.2 branch. All tests pass in both mocks and live. The only remaining to-dos are to test against all the currently-supported Faraday libraries and to update the HTTPService tests to reflect the changed code.

https://github.com/arsduo/koala/tree/v1.2

@arsduo
Owner

I've finished all the tests, and they pass both mocked and live with both Net::HTTP and Typhoeus. Koala will offer a parameter to provide a block for configuring middleware and to specify options (globally or per request) that get passed to Faraday.new.

https://github.com/arsduo/koala/tree/v1.2

Happy to call this done :)

@arsduo arsduo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.