Possibly switch the HTTP client to Faraday?
Would you be willing to accept a PR to swap restclient for Faraday? It would be crazy useful to have a configurable HTTP client.
Let me know and we can put some engineering time into this right away.
@jeregrine could you clarify what exactly you want to achieve with it? RestClient is more lightweight than Faraday so I'd only opt for the latter if really needed.
@guilhermesad I'm not sure I've seen anything that says "RestClient is more lightweight" than any other client. I DO know that I can choose my own HTTP client library and use the same one for my project and then do neat things like metrics, pooling connections and swap out different adapters with Faraday. (ex using a native Java client with jruby)
I will prolly end up doing this anyways and maintaining my own fork. I just wanted to test the waters and see if you'd like this.
@jeregrine seems good, I'm in for that :+1: Regarding RestClient being more lightweight, although its package is lighter it seems to be significantly slower:
n = 100
Benchmark.bm do |x|
x.report('RestClient:') { for i in 1..n; RestClient.get 'http://sushi.com/nigiri/sake.json'; end }
x.report('Faraday:') { for i in 1..n; Faraday.get 'http://sushi.com/nigiri/sake.json'; end }
end
user system total real
RestClient: 3.680000 0.170000 3.850000 (107.588036)
Faraday: 0.240000 0.050000 0.290000 ( 44.608382)
So I'm down for switching to Faraday
+1 on this, that would be great!