function drush_backend_batch_process

8.0.x batch.inc drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array())
6.x batch.inc drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array())
7.x batch.inc drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array())
3.x batch.inc drush_backend_batch_process($command = 'batch-process')
4.x batch.inc drush_backend_batch_process($command = 'batch-process')
5.x batch.inc drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array())
master batch.inc drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array())

Process a Drupal batch by spawning multiple Drush processes.

This function will include the correct batch engine for the current major version of Drupal, and will make use of the drush_backend_invoke system to spawn multiple worker threads to handle the processing of the current batch, while keeping track of available memory.

The batch system will process as many batch sets as possible until the entire batch has been completed or half of the available memory has been used.

This function is a drop in replacement for the existing batch_process() function of Drupal.

Parameters

command: The command to call for the back end process. By default this will be the 'backend-process' command, but some commands such as updatedb will have special initialization requirements, and will need to define and use their own command.

7 calls to drush_backend_batch_process()
drush_unit_batch in tests/unit.drush.inc
Command callback.
drush_update_batch in commands/core/drupal/update.inc
Start the database update batch process.
drush_update_batch in commands/core/drupal/update_7.inc
Start the database update batch process.
entity_updates_main in commands/core/drupal/update.inc
Apply pending entity schema updates.
StatusInfoDrupal7::getAvailableReleases in lib/Drush/UpdateService/StatusInfoDrupal7.php
Obtains release info for all installed projects via update.module.

... See full list

File

includes/batch.inc, line 72
Drush batch API.

Code

function drush_backend_batch_process($command = 'batch-process', $args = array(), $options = array()) {
  // Command line options to pass to the command.
  $options['u'] = drush_user_get_class()->getCurrentUserAsSingle()->id();

  drush_include_engine('drupal', 'batch');
  _drush_backend_batch_process($command, $args, $options);
}