MediaWiki  REL1_20
PoolCounterWork Class Reference

Handy class for dealing with PoolCounters using class members instead of callbacks. More...

Inheritance diagram for PoolCounterWork:

List of all members.

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 false.
 fallback ()
 A work not so good (eg.
 getCachedWork ()
 Retrieve the work from cache.
 logError ($status)
 Log an error.

Protected Attributes

 $cacheable = false

Detailed Description

Handy class for dealing with PoolCounters using class members instead of callbacks.

Definition at line 147 of file PoolCounter.php.


Constructor & Destructor Documentation

PoolCounterWork::__construct ( type,
key 
)

Definition at line 243 of file PoolCounter.php.

References PoolCounter\factory().


Member Function Documentation

PoolCounterWork::doWork ( ) [abstract]

Actually perform the work, caching it if needed.

Reimplemented in PoolWorkArticleView.

Referenced by execute().

PoolCounterWork::error ( status)

Do something with the error, like showing it to the user.

Returns:
bool

Reimplemented in PoolWorkArticleView.

Definition at line 176 of file PoolCounter.php.

Referenced by execute().

PoolCounterWork::execute ( skipcache = false)

Get the result of the work (whatever it is), or false.

Parameters:
$skipcachebool
Returns:
bool|mixed

Definition at line 194 of file PoolCounter.php.

References $result, PoolCounter\DONE, doWork(), PoolCounter\ERROR, error(), fallback(), getCachedWork(), PoolCounter\LOCKED, logError(), Status\newFatal(), PoolCounter\QUEUE_FULL, and PoolCounter\TIMEOUT.

A work not so good (eg.

expired one) but better than an error message.

Returns:
mixed work result or false

Reimplemented in PoolWorkArticleView.

Definition at line 168 of file PoolCounter.php.

Referenced by execute().

Retrieve the work from cache.

Returns:
mixed work result or false

Reimplemented in PoolWorkArticleView.

Definition at line 159 of file PoolCounter.php.

Referenced by execute().

Log an error.

Parameters:
$statusStatus

Definition at line 185 of file PoolCounter.php.

References wfDebugLog().

Referenced by execute().


Member Data Documentation

PoolCounterWork::$cacheable = false [protected]

Definition at line 148 of file PoolCounter.php.


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