MediaWiki REL1_32
|
Helper class to handle automatically marking connectons as reusable (via RAII pattern) More...
Public Member Functions | |
__call ( $name, $arguments) | |
Magic __call handler for most Redis functions. | |
__construct (RedisConnectionPool $pool, $server, Redis $conn, LoggerInterface $logger) | |
__destruct () | |
clearLastError () | |
getLastError () | |
getServer () | |
hScan ( $key, &$iterator, $pattern=null, $count=null) | |
Hash Scan Handle this explicity due to needing the iterator passed by reference. | |
isConnIdentical (Redis $conn) | |
luaEval ( $script, array $params, $numKeys) | |
scan (&$iterator, $pattern=null, $count=null) | |
Key Scan Handle this explicity due to needing the iterator passed by reference. | |
setLogger (LoggerInterface $logger) | |
sScan ( $key, &$iterator, $pattern=null, $count=null) | |
Set Scan Handle this explicity due to needing the iterator passed by reference. | |
zScan ( $key, &$iterator, $pattern=null, $count=null) | |
Sorted Set Scan Handle this explicity due to needing the iterator passed by reference. | |
Protected Attributes | |
Redis | $conn |
$lastError | |
LoggerInterface | $logger |
RedisConnectionPool | $pool |
$server | |
Private Member Functions | |
checkAuthentication () | |
Handle authentication errors and automatically reauthenticate. | |
postCallCleanup () | |
Post Redis call cleanup. | |
tryCall ( $method, $arguments) | |
Do the method call in the common try catch handler. | |
Helper class to handle automatically marking connectons as reusable (via RAII pattern)
This class simply wraps the Redis class and can be used the same way
Definition at line 31 of file RedisConnRef.php.
RedisConnRef::__construct | ( | RedisConnectionPool | $pool, |
$server, | |||
Redis | $conn, | ||
LoggerInterface | $logger ) |
RedisConnectionPool | $pool | |
string | $server | |
Redis | $conn | |
LoggerInterface | $logger |
Definition at line 72 of file RedisConnRef.php.
RedisConnRef::__destruct | ( | ) |
Definition at line 303 of file RedisConnRef.php.
RedisConnRef::__call | ( | $name, | |
$arguments ) |
Magic __call handler for most Redis functions.
string | $name | |
array | $arguments |
RedisException |
Definition at line 109 of file RedisConnRef.php.
References tryCall().
|
private |
Handle authentication errors and automatically reauthenticate.
Definition at line 215 of file RedisConnRef.php.
Referenced by tryCall().
RedisConnRef::clearLastError | ( | ) |
Definition at line 97 of file RedisConnRef.php.
RedisConnRef::getLastError | ( | ) |
Definition at line 93 of file RedisConnRef.php.
References $lastError.
RedisConnRef::getServer | ( | ) |
RedisConnRef::hScan | ( | $key, | |
& | $iterator, | ||
$pattern = null, | |||
$count = null ) |
Hash Scan Handle this explicity due to needing the iterator passed by reference.
See: https://github.com/phpredis/phpredis#hScan
string | $key | |
int | &$iterator | |
string | null | $pattern | |
int | null | $count |
Definition at line 191 of file RedisConnRef.php.
References tryCall().
RedisConnRef::isConnIdentical | ( | Redis | $conn | ) |
Redis | $conn |
Definition at line 299 of file RedisConnRef.php.
References $conn.
RedisConnRef::luaEval | ( | $script, | |
array | $params, | ||
$numKeys ) |
string | $script | |
array | $params | |
int | $numKeys |
RedisException |
Definition at line 249 of file RedisConnRef.php.
References $conn, $lastError, $params, $res, and $server.
Referenced by PoolCounterRedis\initAndPopPoolSlotList(), JobQueueRedis\popAndAcquireBlob(), JobQueueRedis\pushBlobs(), PoolCounterRedis\registerAcquisitionTime(), and PoolCounterRedis\release().
|
private |
Post Redis call cleanup.
Definition at line 235 of file RedisConnRef.php.
References $lastError.
Referenced by tryCall().
RedisConnRef::scan | ( | & | $iterator, |
$pattern = null, | |||
$count = null ) |
Key Scan Handle this explicity due to needing the iterator passed by reference.
See: https://github.com/phpredis/phpredis#scan
int | &$iterator | |
string | null | $pattern | |
int | null | $count |
Definition at line 161 of file RedisConnRef.php.
References tryCall().
RedisConnRef::setLogger | ( | LoggerInterface | $logger | ) |
Definition at line 81 of file RedisConnRef.php.
References $logger.
RedisConnRef::sScan | ( | $key, | |
& | $iterator, | ||
$pattern = null, | |||
$count = null ) |
Set Scan Handle this explicity due to needing the iterator passed by reference.
See: https://github.com/phpredis/phpredis#sScan
string | $key | |
int | &$iterator | |
string | null | $pattern | |
int | null | $count |
Definition at line 176 of file RedisConnRef.php.
References tryCall().
|
private |
Do the method call in the common try catch handler.
string | $method | |
array | $arguments |
RedisException |
Definition at line 133 of file RedisConnRef.php.
References $res, checkAuthentication(), and postCallCleanup().
Referenced by __call(), hScan(), scan(), sScan(), and zScan().
RedisConnRef::zScan | ( | $key, | |
& | $iterator, | ||
$pattern = null, | |||
$count = null ) |
Sorted Set Scan Handle this explicity due to needing the iterator passed by reference.
See: https://github.com/phpredis/phpredis#hScan
string | $key | |
int | &$iterator | |
string | null | $pattern | |
int | null | $count |
Definition at line 206 of file RedisConnRef.php.
References tryCall().
|
protected |
Definition at line 35 of file RedisConnRef.php.
Referenced by __construct(), isConnIdentical(), and luaEval().
|
protected |
Definition at line 38 of file RedisConnRef.php.
Referenced by getLastError(), luaEval(), and postCallCleanup().
|
protected |
Definition at line 43 of file RedisConnRef.php.
Referenced by __construct(), and setLogger().
|
protected |
Definition at line 33 of file RedisConnRef.php.
Referenced by __construct().
|
protected |
Definition at line 37 of file RedisConnRef.php.
Referenced by __construct(), getServer(), and luaEval().