You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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).
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).
Activity
lovelydinosaur commentedon May 25, 2020
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
urllib3team 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.
dabeaz commentedon May 25, 2020
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).
lovelydinosaur commentedon May 25, 2020
Oh cool, hiya! 👋
Implementing a concurrency backend requires implementing the
AsyncBackendinterface... https://github.com/encode/httpcore/blob/master/httpcore/_backends/base.pyThat 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.
That'd be pretty fantastic if you're up for it.
brettcannon commentedon May 25, 2020
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
unasyncmodule).cdeler commentedon Aug 23, 2020
@brettcannon are you in progress in this issue? If no, do you mind if I take this one?
brettcannon commentedon Aug 24, 2020
@cdeler I am not working on this, so feel free to go for it!
Implemented curio backend (encode#94)
Fixing PR remarks (encode#94)
Fixing PR remarks (encode#94)
Fixing PR remarks. Mention curio in the same context when the pair of…
Fixing PR remarks. Made pytest.mark.curio completely isolated from co…
Added "curio" test mark programmatically (encode#94)
Implemented curio backend (encode#94)
Fixing PR remarks (encode#94)
5 remaining items
Fixing PR remarks (encode#94)
Fixing PR remarks. Mention curio in the same context when the pair of…
Fixing PR remarks. Made pytest.mark.curio completely isolated from co…
Added "curio" test mark programmatically (encode#94)
Added "curio" test mark programmatically (encode#94)
Fixed PR remarks (encode#94)
Fixed PR remarks (encode#94)
Fixed PR remarks (encode#94)
Fixed PR remarks (encode#94)
PR review (encode#94)
PR review (encode#94)
PR review (encode#94)
PR review (encode#94)
Implement curio backend (#168)