Interface Yiisoft\Mutex\MutexFactoryInterface
| Implemented by | Yiisoft\Mutex\MutexFactory |
|---|
Allows you to create a mutex instance.
Public 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
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;
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;
Signup or Login in order to comment.