$ScheduledTask

$ScheduledTask is being phased out in favor of $CurrentTask, which was introduced experimentally in Version 11.2.

$ScheduledTask

returns within a scheduled task the ScheduledTaskObject or CloudObject for the task.

Details

  • If it is evaluated not within a scheduled task, $ScheduledTask gives None.
  • $ScheduledTask is used to refer to the task within a task evaluation, e.g. to learn the parameters or stop the task.

Examples

Basic Examples  (8)

Print the running scheduled task object:

Print its time specification:

Remove the scheduled task automatically when it is not needed:

Create a task with random wait periods:

Create a task that restarts evaluation as soon as it finishes:

Create a task that runs only once and removes itself after finishing:

Create a task that removes itself once a condition is met:

Create a task that removes itself when an external variable is changed:

Cause the task to be stopped and removed:

Synchronize scheduled tasks using an auxiliary task:

The auxiliary task x1 was removed:

Stop all scheduled tasks:

Wolfram Research (2010), $ScheduledTask, Wolfram Language function, https://reference.wolfram.com/language/ref/$ScheduledTask.html (updated 2014).

Text

Wolfram Research (2010), $ScheduledTask, Wolfram Language function, https://reference.wolfram.com/language/ref/$ScheduledTask.html (updated 2014).

CMS

Wolfram Language. 2010. "$ScheduledTask." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/$ScheduledTask.html.

APA

Wolfram Language. (2010). $ScheduledTask. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$ScheduledTask.html

BibTeX

@misc{reference.wolfram_2024_$scheduledtask, author="Wolfram Research", title="{$ScheduledTask}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/$ScheduledTask.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_$scheduledtask, organization={Wolfram Research}, title={$ScheduledTask}, year={2014}, url={https://reference.wolfram.com/language/ref/$ScheduledTask.html}, note=[Accessed: 21-December-2024 ]}