MediaWiki
master
|
Handle enqueueing of background jobs. More...
Public Member Functions | |
__construct ( $domain, ReadOnlyMode $readOnlyMode, ?array $localJobClasses, array $jobTypeConfiguration, array $jobTypesExcludedFromDefaultQueue, IBufferingStatsdDataFactory $statsdDataFactory, WANObjectCache $wanCache, GlobalIdGenerator $globalIdGenerator) | |
ack (RunnableJob $job) | |
Acknowledge that a job was completed. More... | |
deduplicateRootJob (RunnableJob $job) | |
Register the "root job" of a given job into the queue for de-duplication. More... | |
get ( $type) | |
Get the job queue object for a given queue type. More... | |
getDefaultQueueTypes () | |
Get the list of default queue types. More... | |
getQueueSizes () | |
Get the size of the queues for a list of job types. More... | |
getQueuesWithJobs () | |
Get the list of job types that have non-empty queues. More... | |
getQueueTypes () | |
Get the list of queue types. More... | |
lazyPush ( $jobs) | |
Buffer jobs for insertion via push() or call it now if in CLI mode. More... | |
pop ( $qtype=self::TYPE_DEFAULT, $flags=0, array $ignored=[]) | |
Pop one job off a job queue. More... | |
push ( $jobs) | |
Insert jobs into the respective queues of which they belong. More... | |
queuesHaveJobs ( $type=self::TYPE_ANY) | |
Check if there are any queues with jobs (this is cached) More... | |
waitForBackups () | |
Wait for any replica DBs or backup queue servers to catch up. More... | |
Public Attributes | |
const | TYPE_DEFAULT = 1 |
const | USE_CACHE = 1 |
Protected Member Functions | |
getCoalescedQueues () | |
Protected Attributes | |
MapCacheLRU | $cache |
array | $coalescedQueues |
Map of (bucket => (queue => JobQueue, types => list of types) More... | |
string | $domain |
Wiki domain ID. More... | |
ReadOnlyMode | $readOnlyMode |
Read only mode. More... | |
Handle enqueueing of background jobs.
Definition at line 34 of file JobQueueGroup.php.
JobQueueGroup::__construct | ( | $domain, | |
ReadOnlyMode | $readOnlyMode, | ||
?array | $localJobClasses, | ||
array | $jobTypeConfiguration, | ||
array | $jobTypesExcludedFromDefaultQueue, | ||
IBufferingStatsdDataFactory | $statsdDataFactory, | ||
WANObjectCache | $wanCache, | ||
GlobalIdGenerator | $globalIdGenerator | ||
) |
string | $domain | Wiki domain ID |
ReadOnlyMode | $readOnlyMode | Read-only mode |
array | null | $localJobClasses | |
array | $jobTypeConfiguration | |
array | $jobTypesExcludedFromDefaultQueue | |
IBufferingStatsdDataFactory | $statsdDataFactory | |
WANObjectCache | $wanCache | |
GlobalIdGenerator | $globalIdGenerator |
Definition at line 77 of file JobQueueGroup.php.
References $domain, and $readOnlyMode.
JobQueueGroup::ack | ( | RunnableJob | $job | ) |
Acknowledge that a job was completed.
RunnableJob | $job |
Definition at line 265 of file JobQueueGroup.php.
References $job, and IJobSpecification\getType().
JobQueueGroup::deduplicateRootJob | ( | RunnableJob | $job | ) |
Register the "root job" of a given job into the queue for de-duplication.
This should only be called right after all the new jobs have been inserted.
RunnableJob | $job |
Definition at line 277 of file JobQueueGroup.php.
References wfDeprecated().
JobQueueGroup::get | ( | $type | ) |
Get the job queue object for a given queue type.
string | $type |
Definition at line 104 of file JobQueueGroup.php.
References $domain, and JobQueue\factory().
|
protected |
Definition at line 406 of file JobQueueGroup.php.
References $coalescedQueues, $domain, JobQueue\factory(), and getQueueTypes().
Referenced by getQueueSizes(), and getQueuesWithJobs().
JobQueueGroup::getDefaultQueueTypes | ( | ) |
Get the list of default queue types.
Definition at line 320 of file JobQueueGroup.php.
References getQueueTypes().
Referenced by pop(), and queuesHaveJobs().
JobQueueGroup::getQueueSizes | ( | ) |
Get the size of the queues for a list of job types.
Definition at line 384 of file JobQueueGroup.php.
References getCoalescedQueues(), and getQueueTypes().
JobQueueGroup::getQueuesWithJobs | ( | ) |
Get the list of job types that have non-empty queues.
Definition at line 357 of file JobQueueGroup.php.
References getCoalescedQueues(), and getQueueTypes().
Referenced by pop(), and queuesHaveJobs().
JobQueueGroup::getQueueTypes | ( | ) |
Get the list of queue types.
Definition at line 306 of file JobQueueGroup.php.
Referenced by getCoalescedQueues(), getDefaultQueueTypes(), getQueueSizes(), and getQueuesWithJobs().
JobQueueGroup::lazyPush | ( | $jobs | ) |
Buffer jobs for insertion via push() or call it now if in CLI mode.
IJobSpecification | IJobSpecification[] | $jobs | A single Job or a list of Jobs |
Definition at line 185 of file JobQueueGroup.php.
References DeferredUpdates\addUpdate(), and push().
JobQueueGroup::pop | ( | $qtype = self::TYPE_DEFAULT , |
|
$flags = 0 , |
|||
array | $ignored = [] |
||
) |
Pop one job off a job queue.
This pops a job off a queue as specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
int | string | $qtype | JobQueueGroup::TYPE_* constant or job type string |
int | $flags | Bitfield of JobQueueGroup::USE_* constants |
array | $ignored | List of job types to ignore |
JobQueueError |
Definition at line 213 of file JobQueueGroup.php.
References $job, getDefaultQueueTypes(), and getQueuesWithJobs().
JobQueueGroup::push | ( | $jobs | ) |
Insert jobs into the respective queues of which they belong.
This inserts the jobs into the queue specified by $wgJobTypeConf and updates the aggregate job queue information cache as needed.
IJobSpecification | IJobSpecification[] | $jobs | A single Job or a list of Jobs |
Definition at line 127 of file JobQueueGroup.php.
References $cache, $job, ObjectCache\getLocalClusterInstance(), and MapCacheLRU\set().
Referenced by lazyPush().
JobQueueGroup::queuesHaveJobs | ( | $type = self::TYPE_ANY | ) |
Check if there are any queues with jobs (this is cached)
int | $type | JobQueueGroup::TYPE_* constant |
Definition at line 333 of file JobQueueGroup.php.
References $cache, MapCacheLRU\get(), getDefaultQueueTypes(), ObjectCache\getLocalClusterInstance(), and getQueuesWithJobs().
JobQueueGroup::waitForBackups | ( | ) |
Wait for any replica DBs or backup queue servers to catch up.
This does nothing for certain queue classes.
Definition at line 291 of file JobQueueGroup.php.
References wfDeprecated().
|
protected |
Definition at line 36 of file JobQueueGroup.php.
Referenced by push(), and queuesHaveJobs().
|
protected |
Map of (bucket => (queue => JobQueue, types => list of types)
Definition at line 56 of file JobQueueGroup.php.
Referenced by getCoalescedQueues().
|
protected |
Wiki domain ID.
Definition at line 39 of file JobQueueGroup.php.
Referenced by __construct(), get(), and getCoalescedQueues().
|
protected |
const JobQueueGroup::TYPE_DEFAULT = 1 |
Definition at line 58 of file JobQueueGroup.php.
Referenced by JobRunner\run().
const JobQueueGroup::USE_CACHE = 1 |
Definition at line 61 of file JobQueueGroup.php.
Referenced by JobRunner\run().