46 $this->poolCounter = $poolCounter ??
83 public function error( $status ) {
93 return $this->poolCounter->isFastStaleEnabled();
103 $key = $this->poolCounter->getKey();
105 $this->poolCounter->getLogger()->info(
106 "Pool key '$key' ({$this->type}): " .
107 $status->getMessage()->inLanguage(
'en' )->useDatabase(
false )->text()
138 public function execute( $skipcache =
false ) {
139 if ( !$this->cacheable || $skipcache ) {
140 $status = $this->poolCounter->acquireForMe();
145 $status = $this->poolCounter->acquireForAnyone( 0 );
148 $staleResult = $this->
fallback(
true );
149 if ( $staleResult !==
false ) {
153 $status = $this->poolCounter->acquireForAnyone();
156 $status = $this->poolCounter->acquireForAnyone();
160 if ( !$status->isOK() ) {
166 switch ( $status->value ) {
175 $this->poolCounter->release();
180 if ( $result ===
false ) {
186 throw new LogicException(
187 'Got PoolCounter::DONE from acquireForMe() and ' .
188 'getCachedWork() returned nothing'
203 if ( $result !==
false ) {
216 $status = Status::newFatal( $errors[$status->value] ??
'pool-errorunknown' );
218 return $this->
error( $status );
224class_alias( PoolCounterWork::class,
'PoolCounterWork' );