42 parent::__construct(
'enqueue',
$params );
50 $jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
53 WikiMap::getCurrentWikiDbDomain()->getId() => $jobs
64 $jobMapsByDomain = [];
65 foreach ( $jobsByDomain as $domain => $jobs ) {
66 $jobMapsByDomain[$domain] = [];
67 foreach ( $jobs as
$job ) {
69 $jobMapsByDomain[$domain][] =
$job->toSerializableArray();
71 throw new InvalidArgumentException(
"Jobs must be of type JobSpecification." );
73 $deduplicate = $deduplicate &&
$job->ignoreDuplicates();
77 $eJob =
new self( [
'jobsByDomain' => $jobMapsByDomain ] );
80 $eJob->removeDuplicates = $deduplicate;
94 public function run() {
95 $jobsByDomain = $this->params[
'jobsByDomain'] ?? $this->params[
'jobsByWiki'];
97 foreach ( $jobsByDomain as $domain => $jobMaps ) {
99 foreach ( $jobMaps as $jobMap ) {
102 JobQueueGroup::singleton( $domain )->push( $jobSpecs );
Router job that takes jobs and enqueues them to their proper queues.
static newFromJobsByWiki(array $jobsByWiki)
static newFromLocalJobs( $jobs)
__construct(array $params)
Callers should use the factory methods instead.
static newFromJobsByDomain(array $jobsByDomain)
Job queue task description base code.
static newFromArray(array $map)
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.
Interface for generic jobs only uses the parameters field and are JSON serializable.
if(count( $args)< 1) $job