While I like some ideas behind the "smol" runtime and ecosystem, it is clearly less popular then the tokio run-time. For example, many libraries that perform work asynchronously assume the tokio runtime, which meant we had to linked against it anyway and had to call .compat() on the returned futures to make them awaitable with our smol-based runtime.
Moving from smol to tokio is not even that complicated:
turn main() and spr::spr() into async functions (don't use smol::block_on to run async code)
lose all the .compat() calls that were necessary when libraries returned tokio futures
replace async_process::Command with tokio::process::Command
replace async_process::Stdio with std::process::Stdio
use tokio::time::sleep instead of asyncio::Timer::after
in tokio, the method for waiting om the end of a child process is called wait instead of status
Moving to tokio reduces friction, let's do it!
Test Plan:
I used spr diff --all on a branch with multiple local commits in a test repo.
While I like some ideas behind the "smol" runtime and ecosystem, it is clearly less popular then the
tokio
run-time. For example, many libraries that perform work asynchronously assume the tokio runtime, which meant we had to linked against it anyway and had to call.compat()
on the returned futures to make themawait
able with our smol-based runtime. Moving from smol to tokio is not even that complicated:main()
andspr::spr()
into async functions (don't usesmol::block_on
to run async code).compat()
calls that were necessary when libraries returned tokio futuresasync_process::Command
withtokio::process::Command
async_process::Stdio
withstd::process::Stdio
tokio::time::sleep
instead ofasyncio::Timer::after
wait
instead ofstatus
Moving to tokio reduces friction, let's do it!
Test Plan: I used
spr diff --all
on a branch with multiple local commits in a test repo.