Download the PHP package avtonom/semaphore-bundle without Composer
On this page you can find all versions of the php package avtonom/semaphore-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avtonom/semaphore-bundle
More information about avtonom/semaphore-bundle
Files in avtonom/semaphore-bundle
Package semaphore-bundle
Short Description A generic locking Symfony bundle for PHP, that uses named locks for semaphore acquire and release, to guarantee atomicity
License MIT
Homepage https://github.com/Avtonom/semaphore-bundle
Informations about the package semaphore-bundle
Avtonom semaphore bundle
Integrates zerkalica/semaphore library into Symfony2.
A generic locking Symfony bundle for PHP, that uses named locks for semaphore acquire and release, to guarantee atomicity.
Locking is useful for controlling access to resources in a multi-process or distributed environment.
The idea is that the actual locking mechanism can be implemented in any way you like, in order to fit your technology stack.
Page bundle: https://github.com/Avtonom/semaphore-bundle
Support adapters
- redis
- memcached
- sem (native functionality)
- apc
- flock (filesystem)
-
- doctrine/orm , pdo, sql - (in future versions)
Features
- Check for attempts to lock the same process. There are two variants of this reaction: throw an exception or extend the lifetime of the key.
- Check before removing the key, he put this process. It is to be found that the key did not die at the time and did not put another process.
- Notification that the script finished and forgot to remove the lock.
- Logging operations with all the necessary information on a specific channel in monolog (channel: semaphore)
- Select the class for the lock manager (SemaphoreManager)
- Select the object class contains a list of key locks (KeyStorage)
- Demo mode - keeping all logging but does not execute set and validates the key.
- Setting parameters such as:
-
- Number of attempts to acquire a lock
-
- Waiting time between attempts to acquire a lock
-
- Lifetime lock
-
- Prefix key lock
Maybe in the future:
- Notice that the lock had died on key lifetimes
- Adapters for doctrine/orm, pdo, sql
- The administrative interface (Sonata Project) for a list of locks and log management actions
- Stopwatch to see semaphore usage in the timeline of the symfony debug toolbar
To Install
Run the following in your project root, assuming you have composer set up for your project
Switching ^1.4
for the most recent tag.
Add the bundle to app/AppKernel.php
Configuration options (config.yaml):
Configuration options (parameters.yaml):
Create Application\Avtonom\SemaphoreBundle\KeyStorage class:
Need Help?
- Please look the log file %kernel.logs_dir%/%kernel.environment%.semaphore.log
- Create an issue if you've found a bug,
All versions of semaphore-bundle with dependencies
symfony/dependency-injection Version >=2.3.0
symfony/monolog-bundle Version >=2.0.7
zerkalica/semaphore Version ~1.0