MediaWiki master
PoolCounterNull.php
Go to the documentation of this file.
1<?php
8
10
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
46class_alias( PoolCounterNull::class, 'PoolCounterNull' );
A default PoolCounter, which provides no locking.
release()
I have successfully finished my task.Lets another one grab the lock, and returns the workers waiting ...
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.Status Value is one of Locked/Error
Semaphore semantics to restrict how many workers may concurrently perform a task.
int $timeout
Maximum time in seconds to wait for the lock.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:44