Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One thread per call run run()? #14

Open
TwoClocks opened this issue Oct 1, 2018 · 1 comment
Open

One thread per call run run()? #14

TwoClocks opened this issue Oct 1, 2018 · 1 comment
Assignees

Comments

@TwoClocks
Copy link

TwoClocks commented Oct 1, 2018

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.

@polachok
Copy link
Owner

polachok commented Oct 1, 2018

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

@polachok polachok self-assigned this Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants