-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Add is_finished
to Task<T>
#6444
Conversation
crates/bevy_tasks/src/task.rs
Outdated
|
||
/// Returns `true` if the current task is finished. | ||
/// | ||
/// Note that in a multithreaded environment, this task can change finish immediately after calling this function. |
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.
"can change finish"? This is ungrammatical, but I can't quite figure out what's intended to give you a direct suggestion :)
crates/bevy_tasks/src/task.rs
Outdated
|
||
/// Returns `true` if the current task is finished. | ||
/// | ||
/// Note that in a multithreaded environment, this task can change finish immediately after calling this function. |
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.
I'd like to see a sentence comparing this to polling, and explaining why you might want one vs the other.
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.
Feedback on docs, but once that's cleaned up I'm happy to merge!
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.
bors r+
# Objective In some scenarios it can be useful to check if a task has been finished without polling it. I added a function called `is_finished` to check if a task has been finished. ## Solution Since `async_task` supports it out of the box, it is just a simple wrapper function. ---
is_finished
to Task<T>
is_finished
to Task<T>
# Objective In some scenarios it can be useful to check if a task has been finished without polling it. I added a function called `is_finished` to check if a task has been finished. ## Solution Since `async_task` supports it out of the box, it is just a simple wrapper function. ---
Objective
In some scenarios it can be useful to check if a task has been finished without polling it. I added a function called
is_finished
to check if a task has been finished.Solution
Since
async_task
supports it out of the box, it is just a simple wrapper function.