MediaWiki
REL1_24
|
Job queue runner utility methods. More...
Public Member Functions | |
run (array $options) | |
Run jobs of the specified number/type for the specified time. | |
setDebugHandler ($debug) | |
Protected Attributes | |
callable null | $debug |
Debug output handler *. | |
Private Member Functions | |
assertMemoryOK () | |
Make sure that this script is not too close to the memory usage limit. | |
getBackoffTimeToWait (Job $job) | |
loadBackoffs (array $backoffs, $mode= 'wait') | |
Get the previous backoff expiries from persistent storage On I/O or lock acquisition failure this returns the original $backoffs. | |
runJobsLog ($msg) | |
Log the job message. | |
syncBackoffDeltas (array $backoffs, array &$deltas, $mode= 'wait') | |
Merge the current backoff expiries from persistent storage. |
JobRunner::assertMemoryOK | ( | ) | [private] |
Make sure that this script is not too close to the memory usage limit.
It is better to die in between jobs than OOM right in the middle of one.
MWException |
Definition at line 321 of file JobRunner.php.
JobRunner::getBackoffTimeToWait | ( | Job $ | job | ) | [private] |
Job | $job |
Definition at line 206 of file JobRunner.php.
JobRunner::loadBackoffs | ( | array $ | backoffs, |
$ | mode = 'wait' |
||
) | [private] |
Get the previous backoff expiries from persistent storage On I/O or lock acquisition failure this returns the original $backoffs.
array | $backoffs | Map of (job type => UNIX timestamp) |
string | $mode | Lock wait mode - "wait" or "nowait" |
Definition at line 240 of file JobRunner.php.
JobRunner::run | ( | array $ | options | ) |
Run jobs of the specified number/type for the specified time.
The response map has a 'job' field that lists status of each job, including:
This method outputs status information only if a debug handler was set. Any exceptions are caught and logged, but are not reported as output.
array | $options | Map of parameters:
|
Definition at line 63 of file JobRunner.php.
JobRunner::runJobsLog | ( | $ | msg | ) | [private] |
Log the job message.
string | $msg | The message to log |
Definition at line 343 of file JobRunner.php.
JobRunner::setDebugHandler | ( | $ | debug | ) |
callable | $debug | Optional debug output handler |
Definition at line 36 of file JobRunner.php.
JobRunner::syncBackoffDeltas | ( | array $ | backoffs, |
array &$ | deltas, | ||
$ | mode = 'wait' |
||
) | [private] |
Merge the current backoff expiries from persistent storage.
The $deltas map is set to an empty array on success. On I/O or lock acquisition failure this returns the original $backoffs.
array | $backoffs | Map of (job type => UNIX timestamp) |
array | $deltas | Map of (job type => seconds) |
string | $mode | Lock wait mode - "wait" or "nowait" |
Definition at line 279 of file JobRunner.php.
callable null JobRunner::$debug [protected] |
Debug output handler *.
Definition at line 31 of file JobRunner.php.