Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid importing/using anyio when trio backend is being used. #626

Closed
tomchristie opened this issue Nov 25, 2022 · 0 comments · Fixed by #639
Closed

Avoid importing/using anyio when trio backend is being used. #626

tomchristie opened this issue Nov 25, 2022 · 0 comments · Fixed by #639
Labels

Comments

@tomchristie
Copy link
Member

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]'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant