Skip to content

Foreground versus Background

Sid Roberts edited this page Aug 18, 2019 · 3 revisions

Running jobs in the foreground (sequential):

Job1 -------->
Job2          ----------------->
Job3                            ---->

Running jobs in the background (parallel):

Job1 -------->
Job2 ----------------->
Job3 ---->

For most applications it is recommended to use ->runInBackground() as this is typical of a Cron implementation and is often quicker. If you specifically need to access the output of each Cron Job, use ->runInForeground().

Return types

->runInBackground() returns an array of Process instances.

->runInForeground() returns an array of outputs.

Clone this wiki locally