ririsoft/async-walkdir

document on how to use with tokio runtime

Closed this issue · 2 comments

Am I supposed to use

block_on(async {
    let mut entries = WalkDir::entries("some/path");
    ...
});

even in a async fn that is run by tokio's multithreaded runtime? AFAIU that will setup a separate runtime to run the future.

Hello @ibotty ,

If you already have an async runtime running you can safely use Walkdir, without running another runtime.
This is the whole purpose of this crate.

Does it answer the question ?

Hmm. You are totally right, it works in my toy example. I'll figure out, what the problem was in my bigger app.