-
Notifications
You must be signed in to change notification settings - Fork 135
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
make wait_socket_{readable,writable}() accept a file descriptor #386
Comments
I don't really encourage the use of these functions as they don't work on Windows. What use case did you have in mind? |
I'm trying to see if psycopg could work with anyio, see psycopg/psycopg#29 and discussions in psycopg/psycopg2#1057. (I am aware of the limitations.) |
What would you pass to these functions if not a |
Does |
I'd pass a |
In fact |
|
So as not to change the scope of the functions, can we easily check that a file descriptor refers to a socket and not another type of file? |
We could let the back-end do that but I would like to keep the resulting exception consistent. |
I don't know in general. |
Could you not just use |
|
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 Perhaps we should maintain a cache of these for performance?
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 Perhaps we should maintain a cache of these for performance?
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 Perhaps we should maintain a cache of these for performance?
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 Perhaps we should maintain a cache of these for performance?
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 Perhaps we should maintain a cache of these for performance?
XXX: tests fail! We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 In tests, we define 'wait_{conn_,}_async' fixtures that will pick either asyncio or anyio waiting functions depending on the value of 'anyio_backend' parametrized fixture (which will be either 'asyncio' and 'trio').
We need to build a socket object in these functions in order to use anyio.wait_socket_{readable,writable}(). See discussions at agronholm/anyio#386 In tests, we define 'wait_{conn_,}_async' fixtures that will pick either asyncio or anyio waiting functions depending on the value of 'anyio_backend' parametrized fixture (which will be either 'asyncio' and 'trio').
Both asyncio's
add_reader/writer()
and trio'swait_{readable,writable}()
accept a file descriptor argument along with any object with afileno()
method (not just asocket.socket
).Can we make anyio support a similar interface?
(Perhaps following trio's names and drop the _socket part from functions name?)
Happy to work on a PR if agreed.
The text was updated successfully, but these errors were encountered: