Свойство | Тип | Описание | |
---|---|---|---|
$connectionFactory | Predis\Connection\FactoryInterface | ||
$current | Predis\Connection\NodeConnectionInterface | ||
$master | Predis\Connection\NodeConnectionInterface | ||
$pool | Predis\Connection\NodeConnectionInterface[] | ||
$retryLimit | integer | -1 = unlimited retry attempts 0 = no retry attempts (fails immediatly) n = fail only after n retry attempts | |
$retryWait | integer | Time to wait in milliseconds before fetching a new configuration from one of the sentinel servers. | |
$sentinelConnection | Predis\Connection\NodeConnectionInterface | ||
$sentinelTimeout | float | ||
$sentinels | Predis\Connection\NodeConnectionInterface[] | ||
$service | string | ||
$slaves | Predis\Connection\NodeConnectionInterface[] | ||
$strategy | |||
$updateSentinels | boolean | Flag for automatic fetching of available sentinels. |
Метод | Описание | |
---|---|---|
__construct ( string $service, array $sentinels, Predis\Connection\FactoryInterface $connectionFactory, |
||
__sleep ( ) | ||
add ( Predis\Connection\NodeConnectionInterface $connection ) | ||
connect ( ) | ||
disconnect ( ) | ||
executeCommand ( Predis\Command\CommandInterface $command ) | ||
getConnectionByCommand ( Predis\Command\CommandInterface $command ) | ||
getConnectionById ( $id ) | ||
getConnectionByRole ( string $role ) : Predis\Connection\NodeConnectionInterface | null | Returns a connection by its role. | |
getCurrent ( ) | ||
getMaster ( ) | ||
getReplicationStrategy ( ) : |
Returns the underlying replication strategy. | |
getSentinelConnection ( ) : Predis\Connection\NodeConnectionInterface | Returns the current sentinel connection. | |
getSlaves ( ) | ||
isConnected ( ) | ||
querySentinel ( ) | Fetches the details for the master and slave servers from a sentinel. | |
readResponse ( Predis\Command\CommandInterface $command ) | ||
remove ( Predis\Connection\NodeConnectionInterface $connection ) | ||
setRetryLimit ( integer $retry ) | Sets the maximum number of retries for commands upon server failure. | |
setRetryWait ( float $seconds ) | Sets the time to wait (in seconds) before fetching a new configuration from one of the sentinels. | |
setSentinelTimeout ( float $timeout ) | Sets a default timeout for connections to sentinels. | |
setUpdateSentinels ( boolean $update ) | Set automatic fetching of available sentinels. | |
switchTo ( Predis\Connection\NodeConnectionInterface $connection ) | Switches the internal connection in use by the backend. | |
switchToMaster ( ) | ||
switchToSlave ( ) | ||
updateSentinels ( ) | Fetches an updated list of sentinels from a sentinel. | |
writeRequest ( Predis\Command\CommandInterface $command ) |
Метод | Описание | |
---|---|---|
assertConnectionRole ( Predis\Connection\NodeConnectionInterface $connection, string $role ) | Asserts that the specified connection matches an expected role. | |
createSentinelConnection ( $parameters ) : Predis\Connection\NodeConnectionInterface | Creates a new connection to a sentinel server. | |
pickSlave ( ) : Predis\Connection\NodeConnectionInterface | Returns a random slave. | |
querySentinelForMaster ( Predis\Connection\NodeConnectionInterface $sentinel, string $service ) : array | Fetches the details for the master server from a sentinel. | |
querySentinelForSlaves ( Predis\Connection\NodeConnectionInterface $sentinel, string $service ) : array | Fetches the details for the slave servers from a sentinel. | |
reset ( ) | Resets the current connection. | |
wipeServerList ( ) | Wipes the current list of master and slaves nodes. |
Метод | Описание | |
---|---|---|
getConnectionInternal ( Predis\Command\CommandInterface $command ) : Predis\Connection\NodeConnectionInterface | Returns the connection instance in charge for the given command. | |
handleSentinelErrorResponse ( Predis\Connection\NodeConnectionInterface $sentinel, Predis\Response\ErrorInterface $error ) | Handles error responses returned by redis-sentinel. | |
retryCommandOnFailure ( Predis\Command\CommandInterface $command, string $method ) : mixed | Retries the execution of a command upon server failure after asking a new configuration to one of the sentinels. |
public __construct ( string $service, array $sentinels, Predis\Connection\FactoryInterface $connectionFactory, |
||
$service | string | Name of the service for autodiscovery. |
$sentinels | array | Sentinel servers connection parameters. |
$connectionFactory | Predis\Connection\FactoryInterface | Connection factory instance. |
$strategy | Replication strategy instance. |
public add ( Predis\Connection\NodeConnectionInterface $connection ) | ||
$connection | Predis\Connection\NodeConnectionInterface |
protected assertConnectionRole ( Predis\Connection\NodeConnectionInterface $connection, string $role ) | ||
$connection | Predis\Connection\NodeConnectionInterface | Connection to a redis server. |
$role | string | Expected role of the server ("master", "slave" or "sentinel"). |
protected createSentinelConnection ( $parameters ) : Predis\Connection\NodeConnectionInterface | ||
Результат | Predis\Connection\NodeConnectionInterface |
public executeCommand ( Predis\Command\CommandInterface $command ) | ||
$command | Predis\Command\CommandInterface |
public getConnectionByCommand ( Predis\Command\CommandInterface $command ) | ||
$command | Predis\Command\CommandInterface |
public getConnectionByRole ( string $role ) : Predis\Connection\NodeConnectionInterface | null | ||
$role | string | Connection role (`master`, `slave` or `sentinel`) |
Результат | Predis\Connection\NodeConnectionInterface | null |
public getReplicationStrategy ( ) : |
||
Результат |
public getSentinelConnection ( ) : Predis\Connection\NodeConnectionInterface | ||
Результат | Predis\Connection\NodeConnectionInterface |
protected pickSlave ( ) : Predis\Connection\NodeConnectionInterface | ||
Результат | Predis\Connection\NodeConnectionInterface |
public querySentinel ( ) |
protected querySentinelForMaster ( Predis\Connection\NodeConnectionInterface $sentinel, string $service ) : array | ||
$sentinel | Predis\Connection\NodeConnectionInterface | Connection to a sentinel server. |
$service | string | Name of the service. |
Результат | array |
protected querySentinelForSlaves ( Predis\Connection\NodeConnectionInterface $sentinel, string $service ) : array | ||
$sentinel | Predis\Connection\NodeConnectionInterface | Connection to a sentinel server. |
$service | string | Name of the service. |
Результат | array |
public readResponse ( Predis\Command\CommandInterface $command ) | ||
$command | Predis\Command\CommandInterface |
public remove ( Predis\Connection\NodeConnectionInterface $connection ) | ||
$connection | Predis\Connection\NodeConnectionInterface |
public setRetryLimit ( integer $retry ) | ||
$retry | integer | Number of retry attempts. |
public setRetryWait ( float $seconds ) | ||
$seconds | float | Time to wait before the next attempt. |
public setSentinelTimeout ( float $timeout ) | ||
$timeout | float | Timeout value. |
public setUpdateSentinels ( boolean $update ) | ||
$update | boolean | Enable or disable automatic updates. |
public switchTo ( Predis\Connection\NodeConnectionInterface $connection ) | ||
$connection | Predis\Connection\NodeConnectionInterface | Connection instance in the pool. |
public updateSentinels ( ) |
protected wipeServerList ( ) |
public writeRequest ( Predis\Command\CommandInterface $command ) | ||
$command | Predis\Command\CommandInterface |
protected FactoryInterface,Predis\Connection $connectionFactory | ||
Результат | Predis\Connection\FactoryInterface |
protected NodeConnectionInterface,Predis\Connection $current | ||
Результат | Predis\Connection\NodeConnectionInterface |
protected NodeConnectionInterface,Predis\Connection $master | ||
Результат | Predis\Connection\NodeConnectionInterface |
protected NodeConnectionInterface[],Predis\Connection $pool | ||
Результат | Predis\Connection\NodeConnectionInterface[] |
protected int $retryLimit | ||
Результат | integer |
protected int $retryWait | ||
Результат | integer |
protected NodeConnectionInterface,Predis\Connection $sentinelConnection | ||
Результат | Predis\Connection\NodeConnectionInterface |
protected NodeConnectionInterface[],Predis\Connection $sentinels | ||
Результат | Predis\Connection\NodeConnectionInterface[] |
protected NodeConnectionInterface[],Predis\Connection $slaves | ||
Результат | Predis\Connection\NodeConnectionInterface[] |
protected ReplicationStrategy,Predis\Replication $strategy | ||
Результат |
protected bool $updateSentinels | ||
Результат | boolean |