-
-
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
Add run conditions for executing a system after a delay #11095
Conversation
This allows the user to specify that the timer should be non-repeating.
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 really like this change (it's flexible and intuitively matches the name), but I think it's a usability regression in most cases.
Instead, I suggest we keep this change, but also:
- Add a
periodically
(or whatever) run condition that works the same as the old on_timer condition. - Doc link between the two methods, explaining why you might want the more verbose form.
- Replicate this for the
on_real_timer
variant.
At this point I wonder if it's worth it to have the more verbose version, or if we have Or maybe |
Yeah, it might make sense just to have the two forms and don't ever expose the |
Alright, I have deprecated the |
Timer
instead of Duration
in on_timer
run conditionThere 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.
Looks good to me. Nice docs.
As per https://discordapp.com/channels/691052431525675048/692572690833473578/1193685432442036235, I reverted the rename of the old run condition. |
Objective
I want to run a system once after a given delay.
on_timer
run condition, but it uses a repeating timer, causing the system to run multiple times.on_timer
with therun_once
run condition. However, this causes the timer to tick only once, so the system is never executed.Solution
Replace(Reverted according to feedback)on_timer
byon_time_interval
andon_real_timer
byon_real_time_interval
to clarify the meaning (the old ones are deprecated to avoid a breaking change).once_after_delay
andonce_after_real_delay
to run the system exactly once after the delay, usingTimerMode::Once
.repeating_after_delay
andrepeating_after_real_delay
to run the system indefinitely after the delay, usingTimer::finished
instead ofTimer::just_finished
.Changelog
Added
once_after_delay
andonce_after_real_delay
run conditions to run the system exactly once after the delay, usingTimerMode::Once
.repeating_after_delay
andrepeating_after_real_delay
run conditions to run the system indefinitely after the delay, usingTimer::finished
instead ofTimer::just_finished
.