Predis\Cluster\Distributor\HashRing::__construct PHP Метод

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

public __construct ( integer $replicas = self::DEFAULT_REPLICAS, mixed $nodeHashCallback = null )
$replicas integer Number of replicas in the ring.
$nodeHashCallback mixed Callback returning a string used to calculate the hash of nodes.
    public function __construct($replicas = self::DEFAULT_REPLICAS, $nodeHashCallback = null)
    {
        $this->replicas = $replicas;
        $this->nodeHashCallback = $nodeHashCallback;
    }

Usage Example

Пример #1
0
 /**
  * @param mixed $nodeHashCallback Callback returning a string used to calculate the hash of nodes.
  */
 public function __construct($nodeHashCallback = null)
 {
     parent::__construct($this::DEFAULT_REPLICAS, $nodeHashCallback);
 }