MediaWiki
master
PoolCounterNull.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\PoolCounter
;
22
23
use
MediaWiki\Status\Status
;
24
31
class
PoolCounterNull
extends
PoolCounter
{
32
33
public
function
__construct
() {
34
$conf = [
// not used for anything, but the parent constructor needs this
35
'workers'
=> 100,
36
'maxqueue'
=> 1000,
37
'timeout'
=> 120,
38
'fastStale'
=> true
39
];
40
parent::__construct( $conf,
'Null'
,
'none'
);
41
}
42
43
public
function
acquireForMe
(
$timeout
=
null
) {
44
return
Status::newGood(
PoolCounter::LOCKED
);
45
}
46
47
public
function
acquireForAnyone
(
$timeout
=
null
) {
48
return
Status::newGood(
PoolCounter::LOCKED
);
49
}
50
51
public
function
release
() {
52
return
Status::newGood(
PoolCounter::RELEASED
);
53
}
54
}
55
57
class_alias( PoolCounterNull::class,
'PoolCounterNull'
);
MediaWiki\PoolCounter\PoolCounterNull
A default PoolCounter, which provides no locking.
Definition
PoolCounterNull.php:31
MediaWiki\PoolCounter\PoolCounterNull\__construct
__construct()
Definition
PoolCounterNull.php:33
MediaWiki\PoolCounter\PoolCounterNull\release
release()
I have successfully finished my task.
Definition
PoolCounterNull.php:51
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:47
MediaWiki\PoolCounter\PoolCounterNull\acquireForMe
acquireForMe( $timeout=null)
I want to do this task and I need to do it myself.
Definition
PoolCounterNull.php:43
MediaWiki\PoolCounter\PoolCounter
Semaphore semantics to restrict how many workers may concurrently perform a task.
Definition
PoolCounter.php:59
MediaWiki\PoolCounter\PoolCounter\LOCKED
const LOCKED
Definition
PoolCounter.php:61
MediaWiki\PoolCounter\PoolCounter\$timeout
int $timeout
Maximum time in seconds to wait for the lock.
Definition
PoolCounter.php:86
MediaWiki\PoolCounter\PoolCounter\RELEASED
const RELEASED
Definition
PoolCounter.php:62
MediaWiki\Status\Status
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition
Status.php:54
MediaWiki\PoolCounter
Definition
PoolCounter.php:21
includes
poolcounter
PoolCounterNull.php
Generated on Wed Jun 18 2025 13:25:24 for MediaWiki by
1.10.0