Background Process Module Limitations and Efficiency? Drupal's Background Process module has been suggested as an alternative to Cron and Batch when heavy lifting is required. The API documentation on background process is good but does not go into details on how it actually works and its' limitations. Can someone explain how Background Process gets around the PHP timeout issue and keeps tasks alive - and whether it operates efficiently (e.g. vs. Batch).

Thank you!
Background Process uses set_time_limit() to control the timeout of the subrequest. It defaults to 0 (php script does not time out, i.e. runs indefinitely).


background_process_start_locked('dontrunconcurrently', 'mymodule_dosomething', $myvar1, $myvar2);


This should be used when you want to ensure that your background process wont run concurrently with itself. In reality the "dontrunconcurrently" is used as a key for a lock.

Background Process has no internal mechanism per se to control serial execution of background processes. 

For serial execution of background processes you could take a look at Background Batch, which allows you to run standard Drupal batch jobs as background processes, or you could maintain a state within your background process function.