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

Pre-associates a connection to a slots range to avoid runtime guessing.
public setSlots ( integer $first, integer $last, Predis\Connection\NodeConnectionInterface | string $connection )
$first integer Initial slot of the range.
$last integer Last slot of the range.
$connection Predis\Connection\NodeConnectionInterface | string ID or connection instance.
 /**
  * @group disconnected
  */
 public function testReturnsCorrectConnectionUsingSlotID()
 {
     $connection1 = $this->getMockConnection('tcp://127.0.0.1:6379');
     $connection2 = $this->getMockConnection('tcp://127.0.0.1:6380');
     $connection3 = $this->getMockConnection('tcp://127.0.0.1:6381');
     $cluster = new RedisCluster(new Connection\Factory());
     $cluster->add($connection1);
     $cluster->add($connection2);
     $cluster->add($connection3);
     $this->assertSame($connection1, $cluster->getConnectionBySlot(0));
     $this->assertSame($connection2, $cluster->getConnectionBySlot(5461));
     $this->assertSame($connection3, $cluster->getConnectionBySlot(10922));
     $cluster->setSlots(5461, 7096, '127.0.0.1:6380');
     $this->assertSame($connection2, $cluster->getConnectionBySlot(5461));
 }