Open rbtcollins opened 10 months ago
(Converting via tokio's asyncfd support isn't possible today, because there is no anonymous Pipe layer today, only unix fd's and windows NamedPipes. Another route forward would be to switch to namedpipes.
https://docs.rs/tokio/latest/tokio/io/unix/struct.AsyncFd.html?search=asyncfd
imo there's tokio-pipe for tokio
@NobodyXu oh, thank you, will give that a go, but its not a like-for-like drop in as I can see: it requires unsafe and bouncing through asrawfd / from rawfd - which os_pipe can be used this way as well - nothing like the ergonomics of os_pipe for std::process:Command.
@rbtcollins which function is missing?
There's a pipe()
for creating pipes, though there isn't a try_clone()
function.
Do you need try_clone()
?
It should be very easy to add that support to the crate.
e.g. AsyncRead, AsyncBufRead etc. This would require a dependency on futures, so perhaps a feature flag. Wouldn't need to bring in tokio or anything large, and as far as I can tell aligns well with the intent of a mid-layer crate.