MutexTrait
- Type
- Trait
- Namespace
- craft\mutex
- Implemented by
- craft\mutex\Mutex
- Since
- 3.7.30
View source (opens new window)
# Public Properties
Property | Description |
---|---|
namePrefix | string (opens new window) – A string prefixed to every lock name. |
# namePrefix
- Type
- string (opens new window)
- 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.
View source (opens new window)
# 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()
View source (opens new window)
Arguments
$name
(string (opens new window))$timeout
(integer (opens new window))
Returns
# init()
Initializes the component.
View source (opens new window)
# isAcquired()
View source (opens new window)
Arguments
$name
(string (opens new window))
Returns
# release()
View source (opens new window)
Arguments
$name
(string (opens new window))
Returns
# releaseQueuedLocks()
Releases any locks that are waiting on the DB transaction to complete.