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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.