ContinuousTask

ContinuousTask[expr]

represents a task in which expr is continuously reevaluated.

ContinuousTask[expr,end]

represents a task in which expr is continuously reevaluated until the time specified by end.

ContinuousTask[expr,tspan]

represents a task in which expr is continuously reevaluated over the time span tspan.

Details and Options

  • CloudSubmit[ContinuousTask[expr]] submits expr for continuous reevaluation in the cloud, starting immediately.
  • Unless they contain blocking functions or Pause specifications, continuous tasks will typically make use of all available processor resources.
  • ContinuousTask is intended primarily for private cloud installations, not the public Wolfram Cloud.
  • If the evaluation of expr leads to abnormal termination or yields $Failed or a Failure object, a series of restarts will be attempted after progressively longer time intervals.
  • Continuous tasks can be controlled using functions like TaskSuspend and TaskResume.
  • The following options can be given:
  • NotificationFunctionAutomatichow to provide notifications
    RestartIntervalAutomatichow long to wait before restarting after failure
    TimeZoneAutomatictime zone for time specifications
  • In ContinuousTask[expr,end], end can be a DateObject or any other date and time specifier.
  • In ContinuousTask[expr,tspan], tspan can be any Quantity object representing a time span.

Examples

Basic Examples  (2)

Deploy a continuous task, requesting notifications for all discrete runs:

In[1]:=
Click for copyable input
Out[1]=

Delete the task:

In[2]:=
Click for copyable input
Out[2]=

Prepare a cloud object containing a counter:

In[1]:=
Click for copyable input

Update the counter from a continuous task:

In[2]:=
Click for copyable input
Out[2]=

Verify the counter has been updated:

In[3]:=
Click for copyable input
Out[3]=

Pause the task:

In[4]:=
Click for copyable input
Out[4]=

The counter is no longer updating:

In[5]:=
Click for copyable input
Out[5]=

Delete the counter and task:

In[6]:=
Click for copyable input
Out[6]=

See Also

ScheduledTask  CloudSubmit  Do  TaskAbort  TaskSuspend  TaskResume  TaskExecute  Pause  SendMail

Introduced in 2015
(10.2)