io-uring icon indicating copy to clipboard operation
io-uring copied to clipboard

Nicer wait with timeout API

Open tinywombat765 opened this issue 4 years ago • 4 comments

liburing has a way to block until completion events come in. I'd be nice to have that functionality in this library. Some like https://unixism.net/loti/ref-liburing/completion.html#c.io_uring_wait_cqe

tinywombat765 avatar May 25 '21 20:05 tinywombat765

Or does submit_and_wait do that? If so, is there a way to set a timeout?

tinywombat765 avatar May 25 '21 20:05 tinywombat765

Okay, I see how this is supposed to work. The thing I'm after is waiting with a timeout. I believe the way to do this is to submit a timeout event then call submit_and_wait. I'd be nice to have a simple wait with timeout function like liburing has.

tinywombat765 avatar May 25 '21 20:05 tinywombat765

You can also use SubmitArgs, see https://github.com/tokio-rs/io-uring/blob/master/io-uring-test/src/tests/timeout.rs#L266

quininer avatar May 26 '21 03:05 quininer

Thanks! That's exactly what I'm looking for. Maybe add doc comment saying that's what that timespec does.

tinywombat765 avatar May 26 '21 03:05 tinywombat765