MediaWiki  1.30.0
JobQueueAggregatorRedis Class Reference

Class to handle tracking information about all queues using PhpRedis. More...

Inheritance diagram for JobQueueAggregatorRedis:
Collaboration diagram for JobQueueAggregatorRedis:

Public Member Functions

 __construct (array $params)
 
- Public Member Functions inherited from JobQueueAggregator
 getAllReadyWikiQueues ()
 Get the list of all of the queues with jobs. More...
 
 notifyQueueEmpty ( $wiki, $type)
 Mark a queue as being empty. More...
 
 notifyQueueNonEmpty ( $wiki, $type)
 Mark a queue as being non-empty. More...
 
 purge ()
 Purge all of the aggregator information. More...
 

Protected Member Functions

 doGetAllReadyWikiQueues ()
 
 doNotifyQueueEmpty ( $wiki, $type)
 
 doNotifyQueueNonEmpty ( $wiki, $type)
 
 doPurge ()
 
 getConnection ()
 Get a connection to the server that handles all sub-queues for this queue. More...
 
- Protected Member Functions inherited from JobQueueAggregator
 findPendingWikiQueues ()
 Get all databases that have a pending job. More...
 

Protected Attributes

LoggerInterface $logger
 
RedisConnectionPool $redisPool
 
array $servers
 List of Redis server addresses. More...
 

Private Member Functions

 decodeQueueName ( $name)
 
 getReadyQueueKey ()
 

Additional Inherited Members

- Static Public Member Functions inherited from JobQueueAggregator
static destroySingleton ()
 Destroy the singleton instance. More...
 
static singleton ()
 
- Static Protected Attributes inherited from JobQueueAggregator
static JobQueueAggregator $instance = null
 

Detailed Description

Class to handle tracking information about all queues using PhpRedis.

The mediawiki/services/jobrunner background service must be set up and running.

Since
1.21

Definition at line 33 of file JobQueueAggregatorRedis.php.

Constructor & Destructor Documentation

◆ __construct()

JobQueueAggregatorRedis::__construct ( array  $params)
Parameters
array$paramsPossible keys:
  • redisConfig : An array of parameters to RedisConnectionPool::__construct().
  • redisServers : Array of server entries, the first being the primary and the others being fallback servers. Each entry is either a hostname/port combination or the absolute path of a UNIX socket. If a hostname is specified but no port, the standard port number 6379 will be used. Required.

Reimplemented from JobQueueAggregator.

Definition at line 50 of file JobQueueAggregatorRedis.php.

References $params, MediaWiki\Logger\LoggerFactory\getInstance(), servers, and RedisConnectionPool\singleton().

Member Function Documentation

◆ decodeQueueName()

JobQueueAggregatorRedis::decodeQueueName (   $name)
private
Parameters
string$name
Returns
string[]

Definition at line 130 of file JobQueueAggregatorRedis.php.

References $name, $type, and list.

Referenced by doGetAllReadyWikiQueues().

◆ doGetAllReadyWikiQueues()

JobQueueAggregatorRedis::doGetAllReadyWikiQueues ( )
protected

◆ doNotifyQueueEmpty()

JobQueueAggregatorRedis::doNotifyQueueEmpty (   $wiki,
  $type 
)
protected
See also
JobQueueAggregator::notifyQueueEmpty()
Parameters
string$wiki
string$type
Returns
bool

Reimplemented from JobQueueAggregator.

Definition at line 60 of file JobQueueAggregatorRedis.php.

◆ doNotifyQueueNonEmpty()

JobQueueAggregatorRedis::doNotifyQueueNonEmpty (   $wiki,
  $type 
)
protected
See also
JobQueueAggregator::notifyQueueNonEmpty()
Parameters
string$wiki
string$type
Returns
bool

Reimplemented from JobQueueAggregator.

Definition at line 64 of file JobQueueAggregatorRedis.php.

◆ doPurge()

JobQueueAggregatorRedis::doPurge ( )
protected
See also
JobQueueAggregator::purge()

Reimplemented from JobQueueAggregator.

Definition at line 97 of file JobQueueAggregatorRedis.php.

◆ getConnection()

JobQueueAggregatorRedis::getConnection ( )
protected

Get a connection to the server that handles all sub-queues for this queue.

Returns
RedisConnRef|bool Returns false on failure
Exceptions
MWException

Definition at line 107 of file JobQueueAggregatorRedis.php.

References as, and servers.

Referenced by doGetAllReadyWikiQueues().

◆ getReadyQueueKey()

JobQueueAggregatorRedis::getReadyQueueKey ( )
private
Returns
string

Definition at line 122 of file JobQueueAggregatorRedis.php.

Referenced by doGetAllReadyWikiQueues().

Member Data Documentation

◆ $logger

LoggerInterface JobQueueAggregatorRedis::$logger
protected

Definition at line 37 of file JobQueueAggregatorRedis.php.

◆ $redisPool

RedisConnectionPool JobQueueAggregatorRedis::$redisPool
protected

Definition at line 35 of file JobQueueAggregatorRedis.php.

◆ $servers

array JobQueueAggregatorRedis::$servers
protected

List of Redis server addresses.

Definition at line 39 of file JobQueueAggregatorRedis.php.


The documentation for this class was generated from the following file: