TaskWait

TaskWait[task]

waits for the specified task to be completely finished.

Details and Options

  • task can be either a TaskObject or task identifier string for a specific task.
  • TaskWait[task] blocks until task is completely finished, then returns the TaskObject[] representing task.
  • For a scheduled task, TaskWait[task] waits until all instances of the task specified in the schedule have been executed.
  • The following option can be given:
  • TimeConstraintInfinitymaximum time to wait before returning
  • TaskWait has attribute Listable.

Examples

open allclose all

Basic Examples  (4)

Start a task in the current session and wait until it finishes:

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

Wait for a task specified by its UUID:

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

Start a task in a separate local kernel and wait until it finishes:

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

Starting an asynchronous task and waiting until it completes is equivalent to running the task synchronously:

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

Options  (1)

See Also

TaskObject  SessionSubmit  LocalSubmit  CloudSubmit  URLSubmit  WaitAll

Introduced in 2017
(11.2)