Starting a task

Tasks (refer to the Tasks section in Chapter 4, Control Flow) are independent units of code execution. Often, we want to start executing them, and then continue executing the main code without waiting for the task result. In other words, we want to start the task asynchronously. This can be done with the @async macro:

a = @async 1 + 2 # Task (done) @0x000000002d70faf0

Get Julia 1.0 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.