-
Notifications
You must be signed in to change notification settings - Fork 47
executor: add spawner #2
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
Conversation
Would this also need the Perhaps instead of Does this really require changes to pub struct Executor {
ex: Arc<multitask::Executor>,
}
pub struct Spawner {
ex: Arc<multitask::Executor>,
} |
Sure, don't know why I didn't sync of the Arc version :) I did the Task::spawner to be symmetrical with Task::spawn but |
Another argument for |
Wrt the LocalSpawner counterpart, I'm not sure if that's necessary. We can add it for symmetry, but if you want to spawn something on the local executor, thus on the current thread, there's a huge change you're already in it right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor nits...
I guess you're right, |
This allows spawning a task on an executor from outside of it Fixes smol-rs#1 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Fixed the comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Published in v0.1.2 |
Thanks! Do you think smol will reexport this or will this stay in the async_executor namespace? |
I think it will stay. |
This allows spawning a task on an executor from outside of it
Fixes #1