Skip to content

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

Closed

Description

@lovelydinosaur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions