MediaWiki
master
PoolCounterNull.php
Go to the documentation of this file.
1
<?php
7
namespace
MediaWiki\PoolCounter
;
8
9
use
MediaWiki\Status\Status
;
10
17
class
PoolCounterNull
extends
PoolCounter
{
18
19
public
function
__construct
() {
20
$conf = [
// not used for anything, but the parent constructor needs this
21
'workers'
=> 100,
22
'maxqueue'
=> 1000,
23
'timeout'
=> 120,
24
'fastStale'
=> true
25
];
26
parent::__construct( $conf,
'Null'
,
'none'
);
27
}
28
30
public
function
acquireForMe
(
$timeout
=
null
) {
31
return
Status::newGood(
PoolCounter::LOCKED
);
32
}
33
35
public
function
acquireForAnyone
(
$timeout
=
null
) {
36
return
Status::newGood(
PoolCounter::LOCKED
);
37
}
38
40
public
function
release
() {
41
return
Status::newGood(
PoolCounter::RELEASED
);
42
}
43
}
44
46
class_alias( PoolCounterNull::class,
'PoolCounterNull'
);
MediaWiki\PoolCounter\PoolCounterNull
A default PoolCounter, which provides no locking.
Definition
PoolCounterNull.php:17
MediaWiki\PoolCounter\PoolCounterNull\__construct
__construct()
Definition
PoolCounterNull.php:19
MediaWiki\PoolCounter\PoolCounterNull\release
release()
I have successfully finished my task.Lets another one grab the lock, and returns the workers waiting ...
Definition
PoolCounterNull.php:40
MediaWiki\PoolCounter\PoolCounterNull\acquireForAnyone
acquireForAnyone( $timeout=null)
I want to do this task, but if anyone else does it instead, it's also fine for me....
Definition
PoolCounterNull.php:35
MediaWiki\PoolCounter\PoolCounterNull\acquireForMe
acquireForMe( $timeout=null)
I want to do this task and I need to do it myself.Status Value is one of Locked/Error
Definition
PoolCounterNull.php:30
MediaWiki\PoolCounter\PoolCounter
Semaphore semantics to restrict how many workers may concurrently perform a task.
Definition
PoolCounter.php:45
MediaWiki\PoolCounter\PoolCounter\LOCKED
const LOCKED
Definition
PoolCounter.php:47
MediaWiki\PoolCounter\PoolCounter\$timeout
int $timeout
Maximum time in seconds to wait for the lock.
Definition
PoolCounter.php:72
MediaWiki\PoolCounter\PoolCounter\RELEASED
const RELEASED
Definition
PoolCounter.php:48
MediaWiki\Status\Status
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition
Status.php:44
MediaWiki\PoolCounter
Definition
PoolCounter.php:7
includes
PoolCounter
PoolCounterNull.php
Generated on Mon Dec 15 2025 19:04:29 for MediaWiki by
1.10.0