MediaWiki master
MediaWiki\PoolCounter\PoolCounterNull Class Reference

A default PoolCounter, which provides no locking. More...

Inherits MediaWiki\PoolCounter\PoolCounter.

Collaboration diagram for MediaWiki\PoolCounter\PoolCounterNull:

Public Member Functions

 __construct ()
 
 acquireForAnyone ( $timeout=null)
 I want to do this task, but if anyone else does it instead, it's also fine for me.
 
 acquireForMe ( $timeout=null)
 I want to do this task and I need to do it myself.
 
 release ()
 I have successfully finished my task.
 
- Public Member Functions inherited from MediaWiki\PoolCounter\PoolCounter
 __construct (array $conf, string $type, string $key)
 
 getKey ()
 
 getLogger ()
 
 isFastStaleEnabled ()
 Is fast stale mode (T250248) enabled? This may be overridden by the PoolCounterWork subclass.
 
 setLogger (LoggerInterface $logger)
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\PoolCounter\PoolCounter
const DONE = 3
 
const ERROR = -1
 
const LOCK_HELD = -5
 
const LOCKED = 1
 
const NOT_LOCKED = -2
 
const QUEUE_FULL = -3
 
const RELEASED = 2
 
const TIMEOUT = -4
 
- Protected Member Functions inherited from MediaWiki\PoolCounter\PoolCounter
 hashKeyIntoSlots ( $type, $key, $slots)
 Given a key (any string) and the number of lots, returns a slot key (a prefix with a suffix integer from the [0..($slots-1)] range).
 
 onAcquire ()
 Update any lock tracking information when the lock is acquired.
 
 onRelease ()
 Update any lock tracking information when the lock is released.
 
 precheckAcquire ()
 Checks that the lock request is sensible.
 
- Protected Attributes inherited from MediaWiki\PoolCounter\PoolCounter
string $key
 All workers with the same key share the lock.
 
LoggerInterface $logger
 
int $maxqueue
 If this number of workers are already working/waiting, fail instead of wait.
 
int $slots = 0
 Maximum number of workers working on this task type, regardless of key.
 
int $timeout
 Maximum time in seconds to wait for the lock.
 
int $workers
 Maximum number of workers working on tasks with the same key simultaneously.
 

Detailed Description

A default PoolCounter, which provides no locking.

Access: internal
Since
1.33

Definition at line 31 of file PoolCounterNull.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\PoolCounter\PoolCounterNull::__construct ( )

Definition at line 33 of file PoolCounterNull.php.

Member Function Documentation

◆ acquireForAnyone()

MediaWiki\PoolCounter\PoolCounterNull::acquireForAnyone ( $timeout = null)

I want to do this task, but if anyone else does it instead, it's also fine for me.

I will read its cached data.

Parameters
int | null$timeoutWait timeout, or null to use value passed to the constructor
Returns
Status Value is one of Locked/Done/Error

Reimplemented from MediaWiki\PoolCounter\PoolCounter.

Definition at line 41 of file PoolCounterNull.php.

References MediaWiki\PoolCounter\PoolCounter\LOCKED.

◆ acquireForMe()

MediaWiki\PoolCounter\PoolCounterNull::acquireForMe ( $timeout = null)

I want to do this task and I need to do it myself.

Parameters
int | null$timeoutWait timeout, or null to use value passed to the constructor
Returns
Status Value is one of Locked/Error

Reimplemented from MediaWiki\PoolCounter\PoolCounter.

Definition at line 37 of file PoolCounterNull.php.

References MediaWiki\PoolCounter\PoolCounter\LOCKED.

◆ release()

MediaWiki\PoolCounter\PoolCounterNull::release ( )

I have successfully finished my task.

Lets another one grab the lock, and returns the workers waiting on acquireForAnyone()

Returns
Status Value is one of Released/NotLocked/Error

Reimplemented from MediaWiki\PoolCounter\PoolCounter.

Definition at line 45 of file PoolCounterNull.php.

References MediaWiki\PoolCounter\PoolCounter\RELEASED.


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