You are here

interface JobTypeInterface in Advanced Queue 8

Defines the interface for job types.

Job types contain logic for processing a given job. For example, sending an email or deleting an expired entity.

Hierarchy

Expanded class hierarchy of JobTypeInterface

All classes that implement JobTypeInterface

1 file declares its use of JobTypeInterface
JobTypeManager.php in src/JobTypeManager.php

File

src/Plugin/AdvancedQueue/JobType/JobTypeInterface.php, line 14

Namespace

Drupal\advancedqueue\Plugin\AdvancedQueue\JobType
View source
interface JobTypeInterface extends PluginInspectionInterface {

  /**
   * Gets the job type label.
   *
   * @return string
   *   The job type label.
   */
  public function getLabel();

  /**
   * Gets the maximum number of retries.
   *
   * When job processing fails, the queue runner will retry the
   * job until the maximum number of retries is reached.
   * Defaults to 0, indicating that retries are disabled.
   *
   * @return int
   *   The job type label.
   */
  public function getMaxRetries();

  /**
   * Gets the retry delay.
   *
   * Represents the number of seconds that should pass before a retried
   * job becomes available again.
   *
   * @return int
   *   The retry delay.
   */
  public function getRetryDelay();

  /**
   * Processes the given job.
   *
   * @param \Drupal\advancedqueue\Job $job
   *   The job.
   *
   * @return \Drupal\advancedqueue\JobResult
   *   The job result.
   */
  public function process(Job $job);

}

Members

Namesort descending Modifiers Type Description Overrides
JobTypeInterface::getLabel public function Gets the job type label. 1
JobTypeInterface::getMaxRetries public function Gets the maximum number of retries. 1
JobTypeInterface::getRetryDelay public function Gets the retry delay. 1
JobTypeInterface::process public function Processes the given job. 4
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