You are here

interface LauncherInterface in Ultimate Cron 8.2

Defines a launcher method.

Hierarchy

Expanded class hierarchy of LauncherInterface

All classes that implement LauncherInterface

File

src/Launcher/LauncherInterface.php, line 14

Namespace

Drupal\ultimate_cron\Launcher
View source
interface LauncherInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface, PluginFormInterface {

  /**
   * Default settings.
   *
   * @return array
   *   Returns array with default configuration of the object.
   */
  public function defaultConfiguration();

  /**
   * Lock job.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   The job to lock.
   *
   * @return string|FALSE
   *   Lock ID or FALSE.
   */
  public function lock(CronJobInterface $job);

  /**
   * Unlock a lock.
   *
   * @param string $lock_id
   *   The lock id to unlock.
   * @param bool $manual
   *   Whether this is a manual unlock or not.
   *
   * @return bool
   *   TRUE on successful unlock.
   */
  public function unlock($lock_id, $manual = FALSE);

  /**
   * Check if a job is locked.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   The job to check.
   *
   * @return string
   *   Lock ID of the locked job, FALSE if not locked.
   */
  public function isLocked(CronJobInterface $job);

  /**
   * Launch job.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   The job to launch.
   *
   * @return bool
   *   TRUE on successful launch.
   */
  public function launch(CronJobInterface $job);

  /**
   * Fallback implementation of multiple lock check.
   *
   * Each launcher should implement an optimized version of this method
   * if possible.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface[] $jobs
   *   Array of UltimateCronJobs to check.
   *
   * @return array
   *   Array of lock ids, keyed by job name.
   */
  public function isLockedMultiple(array $jobs);

  /**
   * Default implementation of jobs launcher.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface[] $jobs
   *   Array of UltimateCronJobs to launch.
   */
  public function launchJobs(array $jobs);

  /**
   * Format running state.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   The running job to format.
   */
  public function formatRunning(CronJobInterface $job);

  /**
   * Format unfinished state.
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   The running job to format.
   */
  public function formatUnfinished(CronJobInterface $job);

  /**
   * Default implementation of formatProgress().
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   Job to format progress for.
   * @param string $progress
   *   Progress value for the Job.
   */
  public function formatProgress(CronJobInterface $job, $progress);

  /**
   * Default implementation of initializeProgress().
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   Job to initialize progress for.
   */
  public function initializeProgress(CronJobInterface $job);

  /**
   * Default implementation of finishProgress().
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   Job to finish progress for.
   */
  public function finishProgress(CronJobInterface $job);

  /**
   * Default implementation of getProgress().
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   Job to get progress for.
   *
   * @return float
   *   Progress for the job.
   */
  public function getProgress(CronJobInterface $job);

  /**
   * Default implementation of getProgressMultiple().
   *
   * @param \Drupal\ultimate_cron\CronJobInterface[] $jobs
   *   Jobs to get progresses for, keyed by job name.
   *
   * @return array
   *   Progresses, keyed by job name.
   */
  public function getProgressMultiple(array $jobs);

  /**
   * Default implementation of setProgress().
   *
   * @param \Drupal\ultimate_cron\CronJobInterface $job
   *   Job to set progress for.
   * @param float $progress
   *   Progress (0-1).
   */
  public function setProgress(CronJobInterface $job, $progress);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
LauncherInterface::defaultConfiguration public function Default settings. Overrides ConfigurableInterface::defaultConfiguration
LauncherInterface::finishProgress public function Default implementation of finishProgress(). 1
LauncherInterface::formatProgress public function Default implementation of formatProgress(). 1
LauncherInterface::formatRunning public function Format running state. 1
LauncherInterface::formatUnfinished public function Format unfinished state. 1
LauncherInterface::getProgress public function Default implementation of getProgress(). 1
LauncherInterface::getProgressMultiple public function Default implementation of getProgressMultiple(). 1
LauncherInterface::initializeProgress public function Default implementation of initializeProgress(). 1
LauncherInterface::isLocked public function Check if a job is locked. 1
LauncherInterface::isLockedMultiple public function Fallback implementation of multiple lock check. 1
LauncherInterface::launch public function Launch job. 1
LauncherInterface::launchJobs public function Default implementation of jobs launcher. 1
LauncherInterface::lock public function Lock job. 1
LauncherInterface::setProgress public function Default implementation of setProgress(). 1
LauncherInterface::unlock public function Unlock a lock. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2