httpcore
httpcore copied to clipboard
Add `asyncio` backend
Summary
Adds back native asyncio
backend based on commit where it was removed here. Adjusts it to work with the new interfaces. This also adds some additional integration testing.
Doesn't make the new backend the default.
AnyIO has considerable overhead so this allows again using the native backend. Also this is going to allow removal of the AnyIO as the dependency (when the synchronization PR goes in also).
Overhead is about 1.45x here (the synchronization has a lot more overhead in the other PR).
Previously (is master):
Now:
Related discussion https://github.com/encode/httpx/issues/3215#issuecomment-2155630018.
Checklist
- [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.