Typhoeus
httpx
Typhoeus | httpx | |
---|---|---|
2 | 1 | |
4,064 | 172 | |
0.1% | - | |
0.0 | 9.3 | |
6 months ago | 6 days ago | |
Ruby | Ruby | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Typhoeus
-
Best Ruby HTTP Clients in 2023
In fact, because the metric is clearly "number of stars", it suggests you two libraries which are either not maintained in almost 3 years, or that haven't had a release in 3 years and a commit in 10 months, despite both of them having a buttload of open issues.
-
The Best Ruby HTTP clients for 2021
Have you had a play with typhoeus by any chance? It's a wrapper over libcurl, so you get OS threads for free - which is kind of nice.
httpx
-
Use Rails
A internal network boundary is probably worth it for heavy jobs, since you usually don't want it to interfere with serving web requests (no matter the tech).
You probably already know what I would say to each of those examples.
> Rails timing out after 30s while allocating 500MB of memory (mostly) in ActiveRecord to compute 5MB of JSON to return to an API caller.
I can make a JS or Go program perform the same way. In fact the exact same thing happened in my shop with Go/Gorm. The key question is: how do you compute the 5mb of JSON? The devil is in those details. We changed the way we computed ours, and the issue was gone.
> 90% of request latency of ~10s spent waiting for downstream services to respond to requests. Most of these could be fired off concurrently (ie `Promise.all` in node). 9s/10s this Rails worker is sitting around doing nothing and eating up ~300MB of memory.
This sounds broken. Why is the worker doing nothing for 9 out of 10s? But like I said earlier, there are a bunch of ways to use HTTP1.1 pipelining to run them concurrently. (https://github.com/excon/excon and https://github.com/HoneyryderChuck/httpx support it, but you can also do that with Net::HTTP I believe) And you can still start threads, which are still concurrent while blocking on IO.
> trying to extract out Authorization to a centralized service (so that other extracted services don't have to call into the monolith in order to make authorization decisions) is a major pain as the monolith now has to make calls out to the centralized auth system to in order to make authz decisions.
This seems unrelated to Rails. Not sure why monolith can't continue handling authorization.
What are some alternatives?
Faraday - Simple, but flexible HTTP client library, with support for multiple backends.
httparty - :tada: Makes http fun again!
RESTClient - Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.
excon - Usable, fast, simple HTTP 1.1 for Ruby
Patron - Ruby HTTP client based on libcurl
HTTP - HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts
Http Client - 'httpclient' gives something like the functionality of libwww-perl (LWP) in Ruby.
Http-2 - Pure Ruby implementation of HTTP/2 protocol
Savon - Heavy metal SOAP client
Unirest - Unirest in Ruby: Simplified, lightweight HTTP client library.
Flexirest - Flexirest - The really flexible REST API client for Ruby
Accept Language - Ruby parser for Accept-Language request HTTP header 🌐