({{, $AsynchronousTask 
returns the current (RefLink[AsynchronousTaskObject, paclet:ref/AsynchronousTaskObject]).}})

OpenersNotesSection(Spacer1)Details

$AsynchronousTask is set when the Wolfram Language evaluates an asynchronous task's event function or error function.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

When the Wolfram Language evaluates the event function, $AsynchronousTask is set to the (RefLink[AsynchronousTaskObject, paclet:ref/AsynchronousTaskObject]) that generated the event:

URLFetchAsynchronous["http://exampledata.wolfram.com/5mb.dat",
If[#2==="data",MessageDialog[Column[{"Download complete for ",$AsynchronousTask}]]]&]

When not running an event function or error function, $AsynchronousTask is not set:

$AsynchronousTask

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}})}})