32 $this->poolCounter = $poolCounter ??
69 public function error( $status ) {
79 return $this->poolCounter->isFastStaleEnabled();
89 $key = $this->poolCounter->getKey();
91 $this->poolCounter->getLogger()->info(
92 "Pool key '$key' ({$this->type}): " .
93 $status->getMessage()->inLanguage(
'en' )->useDatabase(
false )->text()
124 public function execute( $skipcache =
false ) {
125 if ( !$this->cacheable || $skipcache ) {
126 $status = $this->poolCounter->acquireForMe();
131 $status = $this->poolCounter->acquireForAnyone( 0 );
134 $staleResult = $this->
fallback(
true );
135 if ( $staleResult !==
false ) {
139 $status = $this->poolCounter->acquireForAnyone();
142 $status = $this->poolCounter->acquireForAnyone();
146 if ( !$status->isOK() ) {
152 switch ( $status->value ) {
161 $this->poolCounter->release();
166 if ( $result ===
false ) {
172 throw new LogicException(
173 'Got PoolCounter::DONE from acquireForMe() and ' .
174 'getCachedWork() returned nothing'
189 if ( $result !==
false ) {
202 $status = Status::newFatal( $errors[$status->value] ??
'pool-errorunknown' );
204 return $this->
error( $status );
210class_alias( PoolCounterWork::class,
'PoolCounterWork' );