I’m finally learning asyncio with the release of httpx-pycurl, a httpx transport that runs through curl, driving curl’s event loop with asyncio’s. It’s not pretty but it’s fast, with most httpx tests passing when patched to use httpx-pycurl instead of the default transport. Performing 1000 http/2 requests with gather(),
I’m aware of the difficulties with Python http libraries. Might be able to either try / except import httpxyz; allow the module to accept a similar-to-httpx module used as an initializer; implement very-similar requests transport adapters interface such that httpx and requests might share a single transport instance. The adapter between Request / Response objects is much less interesting than being able to drive curl’s event loop from asyncio.
It’s a little confusing to get working. Once it is working there is not much to it. It gives you file handles and you call back into it when one of those handles is readable, or writable; and it just works, and it works efficiently.