Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for wait_readable() and wait_writable() on ProactorEventLoop #831
Add support for wait_readable() and wait_writable() on ProactorEventLoop #831
Changes from 31 commits
a7335d9
d67a150
c1dd759
76d23fa
8b18582
40c7347
1051fcd
01ccdf2
c381617
e21f323
a379ccf
872329a
6980062
19536de
3ea42bf
90b8eea
f68df73
0a94755
8fce306
1d685e4
17140f3
3fc63a4
84029d2
84f05ce
56615c1
65662c8
d9ac670
24fdf30
6826696
d793aa5
24b4a9b
7274d34
e138761
748270b
7c332d6
e19938c
dce49fc
43d1dd4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think this should be in the except's else clause
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought someone might pick up on that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both sockets should be non-blocking, and you should ignore BlockingIOError on the send side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be a loop with a smaller buffer size:
https://github.com/python/cpython/blob/3.13/Lib/asyncio/selector_events.py#L130
Also handing Blocking and Interrupted errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly both of these should be recv_into?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get
BlockingIOError
, but whyInterruptedError
too? System calls are automatically retried by Python whenever they're interrupted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be closed using
with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think you need to close the selector https://docs.python.org/3/library/selectors.html#selectors.BaseSelector.close
Ah you probably want to close it in the join
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm closing the selector and the socket in
stop()
now.