/**
  * Creates the default hash strategy object.
  *
  * @return CommandHashStrategyInterface
  */
 protected function getHashStrategy()
 {
     $distributor = new HashRing();
     $hashGenerator = $distributor->getHashGenerator();
     $strategy = new PredisClusterHashStrategy($hashGenerator);
     return $strategy;
 }
Exemplo n.º 2
0
 /**
  * @param mixed $nodeHashCallback Callback returning the string used to calculate the hash of a node.
  */
 public function __construct($nodeHashCallback = null)
 {
     parent::__construct($this::DEFAULT_REPLICAS, $nodeHashCallback);
 }