-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Remove undocumented public API usage of UnboundedQueue #937
Conversation
…ath.inf)` instead of the deprecated `UnboundedQueue`. - Update windows tests to be consistent with the new data type.
…ryReceiveChannel`. As far as I can tell these methods were already mostly synchronous, but awaited a `checkpoint()` so as to notify any awaiting tasks of the closure. - Update kqueue and windows io managers to close the send ends of their memory channels when appropriate
Codecov Report
@@ Coverage Diff @@
## master #937 +/- ##
==========================================
- Coverage 99.39% 99.37% -0.02%
==========================================
Files 102 102
Lines 12461 12466 +5
Branches 915 913 -2
==========================================
+ Hits 12385 12388 +3
- Misses 56 58 +2
Partials 20 20
|
Hey, welcome! So here's the deal with those low-level APIs: I stuck them in as placeholders when I was first figuring out how Trio's IO should work at all, as a kind of "statement of intent". But then no-one has actually used them so we haven't taken the time to figure out how they should actually work :-). If you want to pick that up, then that'd be awesome! There's some discussion in #26, #578, #579, especially this comment: #578 (comment) Those are just random thoughts at different times though, not like, Pronouncements On The Proper Way To Do Things. I guess the first question is, what is even useful. For Windows, we definitely want a way to handle the super-common pattern of "calling a function that takes an Do we also need a way to monitor a completion key? We have one because I was messing around with There are similar questions for kevent. And if we do want the Do you have any thoughts? |
So my first attempt was in using
So with the above and responding to the rest of your thoughts:
Thanks! I'll try to get back within a week with at least a little bit of the above. |
Oh good point! We should make |
Ok, after toying around with this I think going with making |
Sounds good! |
Long time lurker here, I was tinkering around with using IOCP on Windows (messing with ReadDirectoryChanges), dug into some of the undocumented public methods here, as well as the deprecated warning going along with its usage of UnboundedQueue.
So: I updated it to use channels instead, (as well as the kqueue IOManager version). I have a few questions though:
monitor_kevent
). Should one be written? And if so maybe some guidance on tests, I'm pretty new to those, and don't have the appropriate machine setup ATM. This also seems to be why coverage dropped?close()
method to channels (does the exact same thing, just never awaits a checkpoint). Not sure if this is a thing that makes sense to have or not, but it seemed like it was something that should be used to close the send side of the channel when the IOManager doesn't need it anymore. Maybe there's a better way (queue theaclose()
version in the scheduler?).monitor_completion_key
andmonitor_kevent
yieldMemoryRecieveChannel
s instead ofUnboundedQueue
s). But the API was undocumented to begin with...should I add documentation? Should a news fragment go with this since someone may have been relying on the old interface? And if so, should this wait untilUnboundedQueue
goes from deprecated to removed?UnboundedQueue
isn't used anywhere else after these changes (I know, not a question).This is pretty much just to squash the deprecation warning, as I tinker around I'll have more things I might want to change (ex: the context manager for
monitor_completion_key
is cumbersome to use some cases, though that could just be cause I'm designing my classes wrong for the API).