interface JobExecutorInterface in Apigee Edge 8
Job executor service definition.
Hierarchy
- interface \Drupal\apigee_edge\JobExecutorInterface
Expanded class hierarchy of JobExecutorInterface
All classes that implement JobExecutorInterface
2 files declare their use of JobExecutorInterface
- DeveloperSyncController.php in src/
Controller/ DeveloperSyncController.php - JobQueueWorker.php in src/
Plugin/ QueueWorker/ JobQueueWorker.php
File
- src/
JobExecutorInterface.php, line 28
Namespace
Drupal\apigee_edgeView source
interface JobExecutorInterface {
/**
* Saves a job.
*
* @param \Drupal\apigee_edge\Job\Job $job
* Job object.
*
* @throws \Exception
*/
public function save(Job $job);
/**
* Loads a job from the database.
*
* @param string $id
* Job id.
*
* @return \Drupal\apigee_edge\Job\Job|null
* Loaded job object or null if it does not exit.
*/
public function load(string $id) : ?Job;
/**
* Claims a job if one is available.
*
* @param null|string $tag
* Optional tag to filter with.
*
* @return \Drupal\apigee_edge\Job\Job|null
* Job object or null if there is no available.
*/
public function select(?string $tag = NULL) : ?Job;
/**
* Executes a job synchronously.
*
* @param \Drupal\apigee_edge\Job\Job $job
* Job to run.
* @param bool $update
* Whether to save the job into the database after it ran.
* Setting this to false means that it is the caller's responsibility to
* save the job into the database, else the job will be stuck in the
* "running" state.
*
* @throws \Exception
*/
public function call(Job $job, bool $update = TRUE);
/**
* Executes a job asynchronously.
*
* This puts the job into the "apigee_edge_job" cron queue.
*
* @param \Drupal\apigee_edge\Job\Job $job
* The job to execute later.
*
* @throws \Exception
*/
public function cast(Job $job);
/**
* Counts jobs in the queue.
*
* @param null|string $tag
* Optional tag to filter with.
* @param array|null $statuses
* Optional statues to filter with.
*
* @return int
* Number of counted jobs.
*/
public function countJobs(?string $tag = NULL, ?array $statuses = NULL) : int;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JobExecutorInterface:: |
public | function | Executes a job synchronously. | 1 |
JobExecutorInterface:: |
public | function | Executes a job asynchronously. | 1 |
JobExecutorInterface:: |
public | function | Counts jobs in the queue. | 1 |
JobExecutorInterface:: |
public | function | Loads a job from the database. | 1 |
JobExecutorInterface:: |
public | function | Saves a job. | 1 |
JobExecutorInterface:: |
public | function | Claims a job if one is available. | 1 |