boo1ean / semaphore
Don't let your app be afraid of parallel execution
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/boo1ean/semaphore
Requires
- boo1ean/shared: dev-master
- phpunit/phpunit: 3.7.*@dev
This package is not auto-updated.
Last update: 2025-10-07 12:05:36 UTC
README
This package provide simple semaphore wrapper which can work different adapters
Basic usage
<?php use Semaphore\Semaphore; $lock = new Semaphore(); $key = 'oh no!'; if ($lock->locked($key) { // Meh, it's so locked... } else { // Lock semaphore $lock->lock($key); // Do thread-safe operations reallyImportantCriticalStuff(); // Release lock $lock->unlock($key); }