- Notifications
You must be signed in to change notification settings - Fork341
Adds example to async_std::task::spawn#830
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
shortens count down
disables check because of errors with #[async_std::main]
yoshuawuyts left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Hi, thanks for opening this PR! -- Inthe top-level documentation we explain in more detail how the task model works. However it seems we don't link to it from this function which we probably should.
I'm not sure if this example is the best way to convey howtask::spawn
works. Instead it may be more effective to adapt thestd::thread::spawn
documentation to coverasync_std::task::spawn
:
The join handle will implicitlydetach the child task upon being dropped. In this case, the child task may outlive the parent [...]
tronta commentedJul 10, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, the toplevel description. Would have helped me. |
@tronta hah, yay glad that would've helped -- I would prefer we adapt the docs from |
As I struggled using the function spawn properly (I didn't get that it can be executed without await :-( ), I'd like to add an other example.