Additional functionality related to this tutorial has been introduced in subsequent versions of the Wolfram Language. For the latest information, see Background and Scheduled Tasks.

Asynchronous Tasks

Asynchronous tasks run in the background and evaluate functions asynchronously when there is an event. Asynchronous tasks may run only until some work is completed, or they may be designed to run indefinitely. This tutorial describes how to interact with asynchronous tasks.

AsynchronousTasks[]list running asynchronous tasks
AsynchronousTaskObject["name",id,sessionid]object representing an asynchronous task
StopAsynchronousTask[asyncTask]stop asynchronous evaluations from asyncTask
StartAsynchronousTask[asyncTask]resume asynchronous evaluations from asyncTask
WaitAsynchronousTask[asyncTask]wait for asyncTask to complete
RemoveAsynchronousTask[asyncTask]shut down asyncTask and remove it from the system

Asynchronous task operations.

Normally, there are no asynchronous tasks:
You can list asynchronous tasks that are running. They will be removed from the list when they complete:
Once the dialog telling you the download is complete appears, you can examine the response:
Start a download that takes some time to complete:
Stop asynchronous evaluations, including progress updates:
Restart the asynchronous evaluations, allowing you to see progress updates and get the response data:
You may want to wait up to a certain amount of time for an asynchronous task to finish:
Start two long downloads:
Remove one of the download tasks using its AsynchronousTaskObject expression:
The removed task will no longer be listed: