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
Switching to anyio
as the default backend when running under asyncio
.
#344
Comments
Hooray! 💯 As for curio support, you would have to keep that in anyways since AnyIO has dropped the curio backend (at the request of curio's author). Is there anything you need from me? |
Okay. Just for context, is that a private request, or on a public thread?
Up to you. I'm happy to put in the PR myself, since I've got paid OSS time which I can use to do it, but equally if you were keen to get it in because it's your baby, then you're also welcome to take it on yourself. 🤷♂️😁 Aside: It's interesting to me that Trio's TLSStream implementation has so much more complex locking than the anyio case. I started to have a bit of a deeper dig into that, but just mentioning it here for now. |
I looked at the trio implementation before I made my own; I just couldn't figure out why it was so damn complex. |
I'll try to get a PR done this week. |
Noting it here while I remember - we almost certainly want to set Trio's Also |
The AnyIO backend has done this from the start IIRC, but the trio backend currently doesn't. |
One question remains – is it okay to require the latest anyio as a hard dependency? if so, I'll remove the compatibility code from the backend then. |
One other thing I noticed – all the async tests seem to be running only on trio, or am I missing something? |
Just most of them actually – they're marked with |
Is there any reason at all to use |
Yes. Tho question - are there any API differences between 3.0 and 3.1 that impact us? If we can depend on 3.x then let's do that by preference, otherwise, sure 3.1+.
Not sure without digging, but let's not change anything there as part of any initial PR here. |
AnyIO uses semantic versioning so v3.1 is API compatible with v3.0. It's that httpcore's AnyIO backend was made for AnyIO v2.0 originally, and if anybody requires the older major release then this bump might negatively affect them. My other main concern was adding AnyIO as a hard dependency, regardless of version.
If indeed most tests are only run on trio and not the other backends then this needs to be fixed ASAP, even if in a separate PR. |
Well, yes and no. We don't always need to exercise down to "repeat this test with each individual backend". Eg. if we're testing some connection pooling behaviour, or some part of HTTP/2 fiddlieness, or suchlike, then it's not a terrible thing to just test that against one given backend, so long as we do also have sufficient coverage over testing each of the backends in general. So, mixed bag, but in either case let's treat any convo there as a separate thing. |
Having been bitten by some rough edges in
asyncio
's SSL support, and having taken a look overanyio
's TLSStream implementation. (Which just plain makes sense *) I'm now very warm on the idea of us switching over toanyio
as the default backend for theasyncio
case.We could consider deprecating and later removing the native
curio.py
andasyncio.py
modules, but we don't necessarily need to do that to start with.First step here would be switching the default, and issuing a release, in order to make sure we hit any unexpected issues that might crop up as a result.
Paging @agronholm. 😀
*: In contrast to this, what the heck is
loop.start_tls
? Why is that a property of the event loop? Etc.The text was updated successfully, but these errors were encountered: