Difference between revisions of "Task Scheduling Policy"
(Created page with "Tasks that take time (like, for example, ''Wait'') usually schedule a wake up call, unless the wait is very short, in which case it may simply wait, blocking everything, for t...") |
|||
Line 11: | Line 11: | ||
:[[File:Task_Scheduling_Policy.png]] | :[[File:Task_Scheduling_Policy.png]] | ||
− | + | ''Allow multiple scheduled tasks'' is required in this example, so that each light gets a chance at being turned off. Each light will turn off exactly 5 minutes after it was turned on, regardless of what the other lights did. Note the N (never cancel tasks) next to the <code>with</code> - this is there to ensure that turning off a light manually does not cancel the schedules for all other lights. | |
__NOTOC__ | __NOTOC__ |
Latest revision as of 13:41, 21 April 2017
Tasks that take time (like, for example, Wait) usually schedule a wake up call, unless the wait is very short, in which case it may simply wait, blocking everything, for that short duration. But if the wait is long enough, or the execution time has exceeded safe thresholds, a schedule is saved so that the piston wakes up at the required time. When scheduling a task, the piston has two choices:
Override any existing scheduled tasks
If any previous run resulted in a schedule for the current action, that schedule is dropped and replaced with a new one. This means that any pending tasks inside the action are cancelled and a new action execution is started
Allow multiple scheduled tasks
This option will not cancel the previously scheduled tasks, but it will add a new schedule to the already existing one, causing all the tasks to repeat for as many times as the action was executed
Here is a good example of when to use Allow multiple scheduled tasks:
Allow multiple scheduled tasks is required in this example, so that each light gets a chance at being turned off. Each light will turn off exactly 5 minutes after it was turned on, regardless of what the other lights did. Note the N (never cancel tasks) next to the with
- this is there to ensure that turning off a light manually does not cancel the schedules for all other lights.