0 follower

Interface Yiisoft\Mutex\MutexFactoryInterface

Implemented byYiisoft\Mutex\MutexFactory

Allows you to create a mutex instance.

Public Methods

Hide inherited methods

Method Description Defined By
create() Creates a mutex. Yiisoft\Mutex\MutexFactoryInterface
createAndAcquire() Creates a mutex and acquires a lock. Yiisoft\Mutex\MutexFactoryInterface

Method Details

Hide inherited methods

create() public abstract method

Creates a mutex.

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

Name of the mutex to create.

                public function create(string $name): MutexInterface;

            
createAndAcquire() public abstract method

Creates a mutex and acquires a lock.

public abstract Yiisoft\Mutex\MutexInterface createAndAcquire ( string $name, integer $timeout 0 )
$name string

Name of the mutex to create.

$timeout integer

Time (in seconds) to wait for lock to be released. Defaults to zero meaning that method {@see \Yiisoft\Mutex\MutexInterface::acquire()} will return false immediately in case lock was already acquired.

throws Yiisoft\Mutex\Exception\MutexLockedException

If unable to acquire lock.

                public function createAndAcquire(string $name, int $timeout = 0): MutexInterface;