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

Support the asyncio ProactorEventLoop #77

Closed
njsmith opened this issue Oct 3, 2019 · 2 comments
Closed

Support the asyncio ProactorEventLoop #77

njsmith opened this issue Oct 3, 2019 · 2 comments
Milestone

Comments

@njsmith
Copy link
Collaborator

njsmith commented Oct 3, 2019

Currently anyio's asyncio support relies on APIs like add_reader which are not guaranteed to be available, and in particular are not available when using the ProactorEventLoop on Windows.

Starting in 3.8, the ProactorEventLoop will be the default.

This isn't a big deal for programs that use anyio.run, because that can keep the old SelectorEventLoop default. But it's a big problem for libraries that use anyio internally, since they'll have to document that they don't work on Windows by default, and that anyone who wants to use them has to switch their whole program to a different event loop before they can use the library. That's going to be pretty awkward.

Tornado has a similar problem: tornadoweb/tornado#2608

The standard asyncio solution to this is to use the protocols/transports layer; that's the lowest-level layer that's guaranteed to be portable. anyio might have to figure out how to do that...

@njsmith
Copy link
Collaborator Author

njsmith commented Oct 3, 2019

Some relevant discussion on BPO: https://bugs.python.org/issue37373

@agronholm agronholm added this to the 2.0.0 milestone Oct 3, 2019
@agronholm
Copy link
Owner

I've mitigated this somewhat in the last couple commits. Should reduce the number of users hit by this issue. I've started work on an alternative networking implementation which, unfortunately, nixes wait_socket_readable() and wait_socket_writable() as they cannot be supported on Windows + asyncio.

agronholm added a commit that referenced this issue Jul 28, 2020
- Separated TLS from TCP streams
- Used trustme to provide dummy certificates
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Added the "family" property to socket streams

Fixes #77.
agronholm added a commit that referenced this issue Jul 28, 2020
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Used trustme to provide dummy certificates
- Separated TLS from TCP streams
- Separated buffering functionality from the SocketStream class into BufferedByteReceiveStream
- Added the "family" property to socket streams
- Added text streams

Fixes #77. Fixes #7.
agronholm added a commit that referenced this issue Jul 29, 2020
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Used trustme to provide dummy certificates
- Separated TLS from TCP streams
- Separated buffering functionality from the SocketStream class into BufferedByteReceiveStream
- Added the "family" property to socket streams
- Added text streams

Fixes #77. Fixes #7.
agronholm added a commit that referenced this issue Jul 29, 2020
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Used trustme to provide dummy certificates
- Separated TLS from TCP streams
- Separated buffering functionality from the SocketStream class into BufferedByteReceiveStream
- Added the "family" property to socket streams
- Added text streams

Fixes #77. Fixes #7.
agronholm added a commit that referenced this issue Jul 30, 2020
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Used trustme to provide dummy certificates
- Separated TLS from TCP streams
- Separated buffering functionality from the SocketStream class into BufferedByteReceiveStream
- Added the "family" property to socket streams
- Added text streams

Fixes #77. Fixes #7.
agronholm added a commit that referenced this issue Jul 30, 2020
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Used trustme to provide dummy certificates
- Separated TLS from TCP streams
- Separated buffering functionality from the SocketStream class into BufferedByteReceiveStream
- Added the "family" property to socket streams
- Added text streams

Fixes #77. Fixes #7.
mjwestcott pushed a commit to mjwestcott/anyio that referenced this issue Aug 5, 2020
- Used transports and protocols on asyncio for compatibility with ProactorEventLoop
- Used trustme to provide dummy certificates
- Separated TLS from TCP streams
- Separated buffering functionality from the SocketStream class into BufferedByteReceiveStream
- Added the "family" property to socket streams
- Added text streams

Fixes agronholm#77. Fixes agronholm#7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants