malkusch\lock\mutex\RedisMutex::__construct PHP Method

__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.
    public function __construct(array $redisAPIs, $name, $timeout = 3)
    {
        parent::__construct($name, $timeout);
        $this->redisAPIs = $redisAPIs;
        $this->logger = new NullLogger();
        $this->seedRandom();
    }

Usage Example

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);
 }
All Usage Examples Of malkusch\lock\mutex\RedisMutex::__construct