-
Notifications
You must be signed in to change notification settings - Fork 0
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
async Read/Write: can we use async read instead of non_blocking_read? #10
Comments
Some thoughts from initial investigations: The key difference between If we only have Implementers must also only use a single await and not return pending for any reason other than to indicate that the call would block. If they don't do this, then calling from a ready loop will not work because on a pending result, the caller will drop the future and await Another issue is that although this simplifies the API of Read and Write, it doesn't make things very easy for intermediate implementers. They must still consider |
What about completion based async io like io-uring? In io-uring setting, you can submit a read I/O to network or filesystem in a truly async manner and simply wait for the entry to appear in cqe, and you don't need any |
Completion based IO is likely to use BufRead or OwnedRead or similar, rather than these functions |
I'm in agreement with @nrc here. |
If we were to add a |
With uring, it's interesting because you actually have efficient readiness-based IO via IORING_OP_POLL, however you just have more efficient APIs that are completion based which you generally want to use instead. |
Because returning
WouldBlock
is pretty much like returningPending
, except that it gets processed by the user in the ready loop rather than an executor, but that seems not important. If it works, this would make the Read and Write traits much simplerCredit for the idea to @joshtriplett
The text was updated successfully, but these errors were encountered: