Credis_Cluster::byHash PHP Method

byHash() public method

Get the client that the key would hash to.
public byHash ( string $key ) : Credis_Client
$key string
return Credis_Client
    public function byHash($key)
    {
        return $this->clients[$this->hash($key)];
    }

Usage Example

Beispiel #1
0
 public function testByHash()
 {
     $this->cluster->set('key', 'value');
     $this->assertEquals(6379, $this->cluster->byHash('key')->getPort());
 }