MutexTrait ​
- Type
- Trait
- Namespace
- craft\mutex
- Implemented by
- craft\mutex\Mutex, craft\mutex\MysqlMutex, craft\mutex\PgsqlMutex
- Since
- 3.7.30
Public Properties ​
Property | Description |
---|---|
namePrefix | string – A string prefixed to every lock name. |
namePrefix
​
- Type
- string
- Default value
''
A string prefixed to every lock name. This can be used to avoid lock conflicts if multiple applications are sharing the same database connection.
Public Methods ​
Method | Description |
---|---|
acquire() | |
init() | Initializes the component. |
isAcquired() | |
release() | |
releaseQueuedLocks() | Releases any locks that are waiting on the DB transaction to complete. |
acquire()
​
Arguments ​
Returns ​
init()
​
Initializes the component.
isAcquired()
​
Arguments ​
$name
(string)
Returns ​
release()
​
Arguments ​
$name
(string)
Returns ​
releaseQueuedLocks()
​
Releases any locks that are waiting on the DB transaction to complete.