0 follower

Final Class Yiisoft\Mutex\Redis\RedisMutexFactory

InheritanceYiisoft\Mutex\Redis\RedisMutexFactory » Yiisoft\Mutex\MutexFactory

Allows creating {@see RedisMutex} mutex objects.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( \Predis\ClientInterface $client, integer $ttl 30 )
$client \Predis\ClientInterface

Predis client instance to use.

$ttl integer

Number of seconds in which the lock will be auto released.

                public function __construct(ClientInterface $client, int $ttl = 30)
{
    $this->client = $client;
    $this->ttl = $ttl;
}

            
create() public method

public \Yiisoft\Mutex\MutexInterface create ( string $name )
$name string

                public function create(string $name): MutexInterface
{
    return new RedisMutex($name, $this->client, $this->ttl);
}