Lock API Documentation
SoPHIE Lock API Class
The Lock API provides functionality to prevent multiple script to run at the same time
Init: $lockApi = $api->get('sophie_lock');
Method: $lockApi->acquire(...)
Acquire a custom named lock
Parameters:
- String $name
- int $timeout
Returns Boolean
Method: $lockApi->release(...)
Release a custom named lock
Parameters:
- String $name
Returns Boolean
Method: $lockApi->isAcquired(...)
Check if a lock is acquired for a custom named lock
Parameters:
- String $name
Returns Boolean
Method: $lockApi->acquireSession(...)
Acquire session lock
Parameters:
- int $timeout
Returns Boolean
Method: $lockApi->releaseSession(...)
Release session lock
Method: $lockApi->acquireGroup(...)
Acquire a group lock
Parameters:
- String $groupLabel
- int $timeout
Returns Boolean
Method: $lockApi->releaseGroup(...)
Release a group lock
Parameters:
- String $groupLabel
Method: $lockApi->acquireParticipants(...)
Acquire multiple participants lock
Parameters:
- Array $participantList list of participant labels that should be locked
Returns Boolean
Method: $lockApi->releaseParticipants(...)
Release multiple participant lock
Parameters:
- String $participantList list of participant labels that should be unlocked
Returns Boolean
Method: $lockApi->acquireParticipant(...)
Acquire a participant lock
Parameters:
- String $participantLabel
- int $timeout
Returns Boolean
Method: $lockApi->releaseParticipant(...)
Release a participant lock
Parameters:
- String $participantLabel
Returns Boolean