-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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] - Fix crash when using Duration::MAX #4900
Conversation
Signed-off-by: Alex Saveau <[email protected]>
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.
Good choice. Can we document this behavior under ControlFlow
?
Do you mean add a comment near the if statement? |
Ah my bad. No, I meant as a comment on the variants in UpdateMode. |
Signed-off-by: Alex Saveau <[email protected]>
Gotya, done. |
@@ -68,7 +68,11 @@ pub enum UpdateMode { | |||
/// Once the app has executed all bevy systems and reaches the end of the event loop, there is | |||
/// no way to force the app to wake and update again, unless a `winit` event (such as user | |||
/// input, or the window being resized) is received or the time limit is reached. | |||
Reactive { max_wait: Duration }, | |||
Reactive { | |||
/// The maximum time to wait before the event loop runs again. Note that if the duration is |
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.
These should be line split, and the advice should be more precise. What do we need to set the value to in order to get an indefinite wait?
In many ways, this is actually a feature, so we should demonstrate how to use it.
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.
Well the problem is that it's platform dependent. Some platforms store Instants as u32s, others store them as u64s so the answer is "dunno, you figure it out." :) That said, using Duration::MAX is effectively the same as waiting for ever so I made a note of that.
Signed-off-by: Alex Saveau <[email protected]>
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.
Perfect, thanks!
bors r+ |
# Objective If you set the `ReactiveLowPower` max wait to `Duration::MAX`, stuff panics. Fix that. ## Solution Wait forever if addition failed.
# Objective If you set the `ReactiveLowPower` max wait to `Duration::MAX`, stuff panics. Fix that. ## Solution Wait forever if addition failed.
# Objective If you set the `ReactiveLowPower` max wait to `Duration::MAX`, stuff panics. Fix that. ## Solution Wait forever if addition failed.
Objective
If you set the
ReactiveLowPower
max wait toDuration::MAX
, stuff panics. Fix that.Solution
Wait forever if addition failed.