Interface Yiisoft\Mutex\MutexFactoryInterface
| Implemented by | Yiisoft\ |
|---|
Allows you to create a mutex instance.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| create() | Creates a mutex. | Yiisoft\ |
| createAndAcquire() | Creates a mutex and acquires a lock. | Yiisoft\ |
Method Details
Creates a mutex.
| public abstract Yiisoft\ | ||
| $name | string |
Name of the mutex to create. |
public function create(string $name): MutexInterface;
Creates a mutex and acquires a lock.
| public abstract Yiisoft\ | ||
| $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 \ |
| throws | Yiisoft\ |
If unable to acquire lock. |
|---|---|---|
public function createAndAcquire(string $name, int $timeout = 0): MutexInterface;
User Contributed Notes
Leave a comment
Join the conversation to share a note.