MediaWiki master
PoolCounterNull.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\PoolCounter;
22
24
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
57class_alias( PoolCounterNull::class, 'PoolCounterNull' );
A default PoolCounter, which provides no locking.
release()
I have successfully finished my task.
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.
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:54