Without this PR cradle spawns 3 OS threads (with std::thread::spawn) per executed child process. These are used to write to stdin and read from stderr and stdout. This PR switches to using tokio and async io. This may be good, since -- at least on linux -- OS threads are not super efficient.
This is currently just a WIP PR.
One open question: Can we even start a tokio runtime without destroying the ability of library users to use async runtimes themselves?
Without this PR
cradle
spawns 3 OS threads (withstd::thread::spawn
) per executed child process. These are used to write tostdin
and read fromstderr
andstdout
. This PR switches to usingtokio
and async io. This may be good, since -- at least on linux -- OS threads are not super efficient.This is currently just a WIP PR.
One open question: Can we even start a
tokio
runtime without destroying the ability of library users to use async runtimes themselves?