-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add run conditions for executing a system after a delay (#11095)
# Objective I want to run a system once after a given delay. - First, I tried using the `on_timer` run condition, but it uses a repeating timer, causing the system to run multiple times. - Next, I tried combining the `on_timer` with the `run_once` run condition. However, this causes the timer to *tick* only once, so the system is never executed. ## Solution - ~~Replace `on_timer` by `on_time_interval` and `on_real_timer` by `on_real_time_interval` to clarify the meaning (the old ones are deprecated to avoid a breaking change).~~ (Reverted according to feedback) - Add `once_after_delay` and `once_after_real_delay` to run the system exactly once after the delay, using `TimerMode::Once`. - Add `repeating_after_delay` and `repeating_after_real_delay` to run the system indefinitely after the delay, using `Timer::finished` instead of `Timer::just_finished`. --- ## Changelog ### Added - `once_after_delay` and `once_after_real_delay` run conditions to run the system exactly once after the delay, using `TimerMode::Once`. - `repeating_after_delay` and `repeating_after_real_delay` run conditions to run the system indefinitely after the delay, using `Timer::finished` instead of `Timer::just_finished`.
- Loading branch information
1 parent
b257fff
commit cf3105a
Showing
1 changed file
with
135 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters