__construct() public method

Sets the Redis APIs.
public __construct ( array $redisAPIs, string $name, integer $timeout = 3 )
$redisAPIs array The Redis APIs.
$name string The lock name.
$timeout integer The time in seconds a lock expires, default is 3.
Example #1
0
 /**
  * Sets the connected Redis APIs.
  *
  * The Redis APIs needs to be connected yet. I.e. Redis::connect() was
  * called already.
  *
  * @param Redis[] $redisAPIs The Redis connections.
  * @param string  $name      The lock name.
  * @param int     $timeout   The time in seconds a lock expires, default is 3.
  *
  * @throws \LengthException The timeout must be greater than 0.
  */
 public function __construct(array $redisAPIs, $name, $timeout = 3)
 {
     parent::__construct($redisAPIs, $name, $timeout);
 }
Example #2
0
 /**
  * Sets the Redis connections.
  *
  * @param Client[] $clients The Redis clients.
  * @param string   $name    The lock name.
  * @param int      $timeout The time in seconds a lock expires, default is 3.
  *
  * @throws \LengthException The timeout must be greater than 0.
  */
 public function __construct(array $clients, $name, $timeout = 3)
 {
     parent::__construct($clients, $name, $timeout);
 }