Run slow parts of the composition in the background

Abstract

How to execute nodes asynchronously

Different parts of the composition can be executing simultaneously. If you have multiple triggers firing events through the composition, events from both triggers can be traveling through the composition at the same time. This fact comes in handy if you want a composition to start working on a slow task and do something quicker in the meantime.

Here’s an example (File > Open Example > Event > Load Image Asynchronously). The slow task, in this case, is to download an image from the internet. Immediately after this composition starts running, it starts downloading the image and, in the meantime, fills the window with a solid color. The Spin Off Event node is what allows the download to happen in the background. If Spin Off Event weren’t there, then the Select Latest node would wait for both Make Color Image and Fetch Image to complete before it executed. But, thanks to Spin Off Event, the Fetch Image node is now executed by a different event than the Make Color Image node, so Select Latest can go ahead and execute as soon as Make Color Image is complete.