Predis\Cluster\StrategyInterface::getSlotByKey PHP Метод

getSlotByKey() публичный Метод

Returns a slot for the given key used for clustering distribution or NULL when this is not possible.
public getSlotByKey ( string $key ) : integer
$key string Key string.
Результат integer
    public function getSlotByKey($key);

Usage Example

Пример #1
0
 /**
  * Retrieves a connection instance from the cluster using a key.
  *
  * @param string $key Key string.
  *
  * @return NodeConnectionInterface
  */
 public function getConnectionByKey($key)
 {
     $hash = $this->strategy->getSlotByKey($key);
     $node = $this->distributor->getBySlot($hash);
     return $node;
 }