You are here

public function SerialLauncher::launch in Ultimate Cron 8.2

Launch job.

Parameters

\Drupal\ultimate_cron\CronJobInterface $job: The job to launch.

Return value

bool TRUE on successful launch.

Overrides LauncherInterface::launch

1 call to SerialLauncher::launch()
SerialLauncher::runThread in src/Plugin/ultimate_cron/Launcher/SerialLauncher.php

File

src/Plugin/ultimate_cron/Launcher/SerialLauncher.php, line 200

Class

SerialLauncher
Ultimate Cron launcher plugin class.

Namespace

Drupal\ultimate_cron\Plugin\ultimate_cron\Launcher

Code

public function launch(CronJobInterface $job) {
  \Drupal::moduleHandler()
    ->invokeAll('cron_pre_launch', array(
    $this,
  ));
  if ($this->currentThread) {
    $init_message = t('Launched in thread @current_thread', array(
      '@current_thread' => $this->currentThread,
    ));
  }
  else {
    $init_message = t('Launched manually');
  }

  // Run job.
  $job_launch = $job
    ->run($init_message);
  \Drupal::moduleHandler()
    ->invokeAll('cron_post_launch', array(
    $this,
  ));
  return $job_launch;
}