-
Notifications
You must be signed in to change notification settings - Fork 744
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
Reconsider supported draining behaviour #1611
Comments
If I understand correctly, it is. |
This can be a pretty impactful optimization in certain workloads. |
One thing we need to consider are the |
I don't think we can change the behaviour any more. The public Based on that I'm going to close this and keep the current behaviour. If someone does have an idea on how to support |
For Unix (
kqueue
andepoll
) to drain readiness all you have to do is read/write until you get a "short" read/write, i.e. less bytes are processed than your buffer size. However Mio doesn't guarantee that another event is return until the I/O operations hits aWouldBlock
error. This means that to strictly follow Mio's docs you'll have to issue another pointless system call (read/write/etc.).This is because on Windows Mio could only guarantee the readiness to be drained once a
WouldBlock
error was returned. However nowadays we control that ourselves inIoSourceState::do_io
. So, we could change it to reregister when e.g. the read bytes < buffer size.Also find out if all of this is true for
poll
(see #1602).The text was updated successfully, but these errors were encountered: