MediaWiki  REL1_22
NullJob Class Reference

Degenerate job that does nothing, but can optionally replace itself in the queue and/or sleep for a brief time period. More...

Inheritance diagram for NullJob:
Collaboration diagram for NullJob:

List of all members.

Public Member Functions

 __construct ($title, $params, $id=0)
 run ()
 Run the job.

Detailed Description

Degenerate job that does nothing, but can optionally replace itself in the queue and/or sleep for a brief time period.

These can be used to represent "no-op" jobs or test lock contention and performance.

Example:
Inserting a null job in the configured job queue:
 $ php maintenance/eval.php
 > $queue = JobQueueGroup::singleton();
 > $job = new NullJob( Title::newMainPage(), array( 'lives' => 10 ) );
 > $queue->push( $job );
You can then confirm the job has been enqueued by using the showJobs.php maintenance utility:
 $ php maintenance/showJobs.php --group
 null: 1 queue; 0 claimed (0 active, 0 abandoned)
 $

Definition at line 47 of file NullJob.php.


Constructor & Destructor Documentation

NullJob::__construct ( title,
params,
id = 0 
)
Parameters:
$titleTitle (can be anything)
array$paramsjob parameters (lives, usleep)
$idInteger: job id

Definition at line 53 of file NullJob.php.

References Job\$id, Job\$params, Job\$title, empty, and params.


Member Function Documentation

Run the job.

Returns:
boolean success

Reimplemented from Job.

Definition at line 64 of file NullJob.php.

References $job, Job\$params, params, JobQueueGroup\singleton(), and title.


The documentation for this class was generated from the following file: