bogkov / concurrency-limit
This component provides the functionality to concurrency limit on server
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/bogkov/concurrency-limit
Requires
- php: ^7.0
- doctrine/cache: ^1.6
Requires (Dev)
- phpunit/phpunit: ^6.2
This package is not auto-updated.
Last update: 2025-09-28 09:45:31 UTC
README
Concurrency Limit
This component provides the functionality to concurrency limit on server
Installation
This package can be installed as a Composer dependency bogkov/concurrency-limit
composer require bogkov/concurrency-limit
Usage
<?php $provider = new \Bogkov\ConcurrencyLimit\Provider\Cache(new \Doctrine\Common\Cache\ArrayCache()); $handler = new \Bogkov\ConcurrencyLimit\Handler($provider); $key = 'some-handle-key'; $limit = 1; if (true === $handler->start($key, $limit)) { echo 'continue process' . PHP_EOL; $handler->end($key); } else { echo 'concurrency limit exceeded' . PHP_EOL; }