Skip to content

Curio support #94

Closed
Closed

Description

@brettcannon

Other than asyncio and trio, curio seems to be the other "big" event loop implementation.

Activity

  1. lovelydinosaur commented on May 25, 2020

    @lovelydinosaur
    Member

    Well indeed. I’ve not yet reached out to @dabeaz to gauge interest here. The backends are a pretty small amount of code, so it’s probably not going to be a huge amount of work if someone’s motivated enough to take it on.

    Also, curio isn’t the only other place we could be reaching out to here... We’re following the lead of the urllib3 team in our approach here, who had also been looking into providing a Twisted backend too.

    I don’t really know anything about that ecosystem, but could be worth reaching out to Amber or Glyph there to figure out if that’s also a valuable avenue to look into.

  2. dabeaz commented on May 25, 2020

    @dabeaz

    I'd definitely be interested in seeing Curio support here, but don't really know what's involved. Curio recently went through a "version 1.0" release that reduced its set of features to a smaller core and likely broke some things for earlier adopters. However, I consider the current version of Curio to be stable and more-or-less feature complete.

    How would this work? Should I just submit a drive-by pull request adding Curio support? (I'm more than happy to have someone else do it if they're motivated though).

  3. lovelydinosaur commented on May 25, 2020

    @lovelydinosaur
    Member

    Oh cool, hiya! 👋

    but don't really know what's involved

    Implementing a concurrency backend requires implementing the AsyncBackend interface... https://github.com/encode/httpcore/blob/master/httpcore/_backends/base.py

    That provides the bare bones for "give me a semaphore", "give me a lock", and "open a TCP stream", which is everything the backend needs to provide.

    The asyncio and trio implementations are worth a quick look over, as the two existing async examples. (There's an equivalent sync implementation too.)

    Once there's an implementation, the other bit is to tie it in with the concurrency autodetection... https://github.com/encode/httpcore/blob/master/httpcore/_backends/auto.py#L17-L28

    For the tests I think it'd be a case of adding curio to https://github.com/encode/httpcore/blob/master/tests/conftest.py#L15-L20 in order to include it in the test parameterization, but I don't recall off the top of my head if there's more beyond that to do.

    Should I just submit a drive-by pull request adding Curio support?

    That'd be pretty fantastic if you're up for it.

  4. brettcannon commented on May 25, 2020

    @brettcannon
    Author

    I would be happy to help @dabeaz out if I can (which doesn't count for much these days with so many OSS projects on the go right now and thus nearly no spare time 😄).

    And doing a search for the word "trio" suggests that what @tomchristie outlined covers nearly everything but packaging details (there was a hit on an unasync module).

  5. cdeler commented on Aug 23, 2020

    @cdeler
    Contributor

    @brettcannon are you in progress in this issue? If no, do you mind if I take this one?

  6. brettcannon commented on Aug 24, 2020

    @brettcannon
    Author

    @cdeler I am not working on this, so feel free to go for it!

  7. 5 remaining items

  8. added a commit that references this issue on Sep 5, 2020
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions