Somewhat prompted by #588 (comment)
When using trio, we currently use native trio for the backend implementation, but use anyio for some synchronisation primitives.
With a bit of careful thinking, and use of sniffio, we could re-jig those synchronisation primitives to avoid that, and ensure that...
- When running under asyncio, we use
anyio for the network backend and synchronisation primitives.
- When running under trio, we use
trio for the network backend and synchronisation primitives.
This would seem to me to be an improvement:
- We would no longer run into any clashes between
anyio and trio versions.
- We'd be in a better position to move to installations with fewer dependancies. Potentially:
'pip install httpcore[asyncio]' and 'pip install httpcore[trio]'.