libjail-rs icon indicating copy to clipboard operation
libjail-rs copied to clipboard

Add support for Tokio Command

Open itpetey opened this issue 2 years ago • 6 comments

itpetey avatar Jun 17 '23 11:06 itpetey

and what does that do?

igalic avatar Jun 17 '23 11:06 igalic

Tokio Command? It's an async version of the std lib, which sits on top of Tokio's runtime.

https://docs.rs/tokio/1.28.2/tokio/process/struct.Command.html

itpetey avatar Jun 17 '23 11:06 itpetey

What primitives does it use? I guess it probably uses asynchronous pipe APIs for stdin and stdout. But does it spawn a thread for wait or use kqueue's EVFILT_PROC to detect when the child has exited?

asomers avatar Jun 17 '23 13:06 asomers

I'm not a Tokio dev, so I don't know what's under the hood. However I do know that Tokio sits on top of Metal I/O, which explicitly supports FreeBSD: https://github.com/tokio-rs/mio.

itpetey avatar Jun 18 '23 00:06 itpetey

LGTM!

fabianfreyer avatar Jun 18 '23 23:06 fabianfreyer