This is mostly useful to support clustering via client-side sharding.
Автор: Daniele Alessandri (suppakilla@gmail.com)
Пример #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;
 }