-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Nonblocking I/O #12353
Comments
This would work for me. This would only affect the result of reads, not writes, correct? The librustuv issue is a bit unfortunate but as long as the event loop is quick, not the end of the world. |
Hm, nonblocking writes is indeed a large problem. I don't know of a way to do a nonblocking write with |
It's not currently possible but it could be made to work if uv_cancel() was taught to cancel uv_write_t requests. Fairly trivial on Unices, maybe less so on Windows. |
Forgot to mention, libuv grew a uv_try_write() function in v0.11.16 but it's currently only implemented on Unices. I don't know how difficult it would be to make it work on Windows. |
Closing in favor of #13336 |
add cargo.toml lint section way of adding lints in the book changelog: add cargo.toml lint section way of adding lints in the book as from [discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.E2.9C.94.20clippy.20config)
A frequently requested feature of I/O I've been seeing is some form of nonblocking I/O. This is a vast and broad topic, but I would like to make this concrete proposal:
The
IoErrorKind
enum would also be extended with a value ofWouldBlock
. This method would be added to only the network streams initially and possibly others as later seen fit.For libnative, this would do the
ioctl
thing or whatever the equivalent is to set the file descriptor into nonblocking mode (can this be done on windows?). For librustuv, this could be a little more difficult. To the best of my knowledge libuv doesn't support a nonblocking read. One possible solution would be to schedule a read and then use an idle callback to cancel the read on the next turn of the event loop. This would technically block the task, but it would be for "a short period of time"Those who desire a form of nonblocking I/O, would this satisfy your needs?
The text was updated successfully, but these errors were encountered: