4 ms·
I agree. For example, most of Rust libraries uses the drop handler (something like desctructors) to close a file descriptor. However it has problems since in as
by hnakamur 5y ago
I agree. For example, most of Rust libraries uses the drop handler (something like desctructors) to close a file descriptor.
However it has problems since in async model closing is also async and it may return an error.
So in tokio-uring explicit async close will be provided.
https://github.com/tokio-rs/tokio-uring/pull/1/files#diff-3dc5dd454e080eb849ee5efaf79df2585fbe0a06804d69249b4c81da05a63875R375-R400 https://github.com/tokio-rs/tokio-uring/pull/1/files#diff-3d...
And you can call close like:
file.close().await.unwrap();
https://github.com/tokio-rs/tokio-uring/pull/17/files#diff-bd6920ff81a489bba8cfe35dc49b5ad7bb4a4f52086f9f8766d25a8f8d791709R71 https://github.com/tokio-rs/tokio-uring/pull/17/files#diff-b...
- pcwalton 5y agoNote that there are ideas to fix this issue in the async foundations WG. It's arguably more of a problem with async as implemented in Rust than with the concept of RAII.