Hi everyone! I just published my first crate,
aahc, the Asynchronous Agnostic HTTP Client.
I was inspired to write this when I was looking at the existing asynchronous HTTP client crates and realized that, as far as I can tell, only Isahc is actually genuinely executor-agnostic (but achieves this by spawning a separate thread to do all the I/O), while everything else either only works with Tokio, or only works with async-std, or uses feature flags to choose either Tokio or async-std, or something similar, but does not work with just any executor at all. By externalizing socket creation,
aahc is executor agnostic: as long as you hand it a socket, which can be anything that implements
futures_io::AsyncWrite, it’ll send an HTTP request over it. Tokio, async-std, Glib, presumably Rustls, any kind of socket your personal choice of executor provides ought to work, with no auxiliary threads. To top it off,
aahc is also 100% safe, makes very few heap allocations (and even they can be disabled), and has a very small deptree (only
I’d appreciate comments on anything, large or small—choice of approach, architecture, code details, metadata, documentation/comments, etc.. While I pointed the repository entry in the metadata at my Gitlab site because I prefer Gitlab, the code is also on Github here; if you want to file a ticket either is fine.