fahrenheit icon indicating copy to clipboard operation
fahrenheit copied to clipboard

One thread per call run run()?

Open TwoClocks opened this issue 7 years ago • 1 comments

Firstly, thanks for doing this.

I'm trying to get my head around Rust's async/await code, and this is very helpful.

If I read this correctly, every call to fahrenheit::run() creates a whole new select() look / thread for that sync code.

How would it change if you wanted a bunch of unrelated asyc{} blocks to use the same single thread / select() loop ?

Or am I just reading this all wrong? Good chance of that. I'm new to rust, but have used async/await in a few other languages.

lastly: Sorry if this is the wrong place to post/ask. I didn't see a comments option on your blog post.

TwoClocks avatar Oct 01 '18 02:10 TwoClocks

You could get a handle and use its spawn_obj method, or just top-level spawn

polachok avatar Oct 01 '18 20:10 polachok