Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
tronta wants to merge3 commits intoasync-rs:main
base:main
Choose a base branch
Loading
fromtronta:adds-example-spaws

Conversation

tronta
Copy link

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.

Peter Sonntagand others added3 commitsJuly 8, 2020 21:07
shortens count down
disables check because of errors with #[async_std::main]
Copy link
Contributor

@yoshuawuytsyoshuawuyts left a comment
edited
Loading

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
Copy link
Author

tronta commentedJul 10, 2020
edited
Loading

Yes, the toplevel description. Would have helped me.
In my opinion, more examples are better than less 😀
What do you think, should be modified? Or do you suggest, this is enough...?
Probably one needs to weigh up the maintenance effort.

@yoshuawuyts
Copy link
Contributor

@tronta hah, yay glad that would've helped -- I would prefer we adapt the docs fromstd::thread for this instead -- putting this behavior into words is probably the right approach here.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@yoshuawuytsyoshuawuytsyoshuawuyts requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@tronta@yoshuawuyts

[8]ページ先頭

©2009-2025 Movatter.jp