WaitAsynchronousTask[task]
waits for task to complete.
WaitAsynchronousTask
WaitAsynchronousTask[task]
waits for task to complete.
Details and Options
- task is an AsynchronousTaskObject expression.
- WaitAsynchronousTask waits until task completes.
- The following option can be given:
-
"Timeout" Infinity time to wait before returning
Examples
open all close allBasic Examples (1)
Options (1)
"Timeout" (1)
Wait for an asynchronous task to complete and then continue, even if it is not done:
done = False;
Print["Starting download at ", DateString[]];
task = URLFetchAsynchronous["http://exampledata.wolfram.com/20mb.dat",
If[#2 === "data", done = True;MessageDialog["Download complete."]]&];
WaitAsynchronousTask[task, "Timeout" -> 1.5]
If[!done, Print["Still downloading at ", DateString[]]]History
Text
Wolfram Research (2012), WaitAsynchronousTask, Wolfram Language function, https://reference.wolfram.com/language/ref/WaitAsynchronousTask.html.
CMS
Wolfram Language. 2012. "WaitAsynchronousTask." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WaitAsynchronousTask.html.
APA
Wolfram Language. (2012). WaitAsynchronousTask. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WaitAsynchronousTask.html
BibTeX
@misc{reference.wolfram_2026_waitasynchronoustask, author="Wolfram Research", title="{WaitAsynchronousTask}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/WaitAsynchronousTask.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_waitasynchronoustask, organization={Wolfram Research}, title={WaitAsynchronousTask}, year={2012}, url={https://reference.wolfram.com/language/ref/WaitAsynchronousTask.html}, note=[Accessed: 15-June-2026]}