MediaWiki REL1_34
|
Class for dealing with PoolCounters using class members. More...
Public Member Functions | |
__construct ( $type, $key) | |
doWork () | |
Actually perform the work, caching it if needed. | |
error ( $status) | |
Do something with the error, like showing it to the user. | |
execute ( $skipcache=false) | |
Get the result of the work (whatever it is), or the result of the error() function. | |
fallback () | |
A work not so good (eg. | |
getCachedWork () | |
Retrieve the work from cache. | |
logError ( $status) | |
Log an error. | |
Protected Attributes | |
bool | $cacheable = false |
string | $type = 'generic' |
Private Attributes | |
PoolCounter | $poolCounter |
Class for dealing with PoolCounters using class members.
Definition at line 27 of file PoolCounterWork.php.
PoolCounterWork::__construct | ( | $type, | |
$key ) |
string | $type | The class of actions to limit concurrency for (task type) |
string | $key | Key that identifies the queue this work is placed on |
Definition at line 39 of file PoolCounterWork.php.
References $type, and PoolCounter\factory().
|
abstract |
Actually perform the work, caching it if needed.
Reimplemented in PoolCounterWorkViaCallback, and PoolWorkArticleView.
Referenced by execute().
PoolCounterWork::error | ( | $status | ) |
Do something with the error, like showing it to the user.
Status | $status |
Reimplemented in PoolCounterWorkViaCallback, and PoolWorkArticleView.
Definition at line 74 of file PoolCounterWork.php.
Referenced by execute().
PoolCounterWork::execute | ( | $skipcache = false | ) |
Get the result of the work (whatever it is), or the result of the error() function.
This returns the result of the first applicable method that returns a non-false value, where the methods are checked in the following order:
bool | $skipcache |
Definition at line 106 of file PoolCounterWork.php.
References PoolCounter\DONE, doWork(), PoolCounter\ERROR, error(), execute(), fallback(), getCachedWork(), PoolCounter\LOCK_HELD, PoolCounter\LOCKED, logError(), PoolCounter\QUEUE_FULL, and PoolCounter\TIMEOUT.
Referenced by PdfHandler\doTransform(), DjVuHandler\doTransform(), SpecialContributions\execute(), execute(), PdfHandler\getMetaArray(), File\getThumbnailSource(), and wfGenerateThumbnail().
PoolCounterWork::fallback | ( | ) |
A work not so good (eg.
expired one) but better than an error message.
Reimplemented in PoolCounterWorkViaCallback, and PoolWorkArticleView.
Definition at line 63 of file PoolCounterWork.php.
Referenced by execute().
PoolCounterWork::getCachedWork | ( | ) |
Retrieve the work from cache.
Reimplemented in PoolCounterWorkViaCallback, and PoolWorkArticleView.
Definition at line 54 of file PoolCounterWork.php.
Referenced by execute().
PoolCounterWork::logError | ( | $status | ) |
Log an error.
Status | $status |
Definition at line 84 of file PoolCounterWork.php.
References wfDebugLog().
Referenced by execute().
|
protected |
Definition at line 31 of file PoolCounterWork.php.
|
private |
Definition at line 33 of file PoolCounterWork.php.
|
protected |
Definition at line 29 of file PoolCounterWork.php.
Referenced by __construct(), and PoolCounterWorkViaCallback\__construct().