bileto / critical-section
Lightweight class supporting critical section locking
v2.1.0
2020-09-17 23:36 UTC
Requires
- php: >=7.1
Requires (Dev)
- jakub-onderka/php-parallel-lint: ^0.9
- mockery/mockery: ^1.3
- nette/tester: ^2.3
- phpstan/phpstan: ^0.12
Suggests
- ext-pdo: PDO module is used to connect to MySQL or PostgreSQL database
- ext-redis: The php redis extension https://github.com/nicolasff/phpredis/ is required for connecting to redis server
- ext-sysvsem: Module required to use Semaphore Driver for Critical Section
Replaces
- stekycz/criticalsection: 1.0.1
This package is auto-updated.
Last update: 2024-11-29 06:22:13 UTC
README
Description
Lightweight class supporting critical section locking in PHP.
It requires PHP >= 7.1 and no other dependency.
Example
$pdo = new PDO('...'); $driver = new Bileto\CriticalSection\Driver\PdoPgsqlDriver($pdo); $criticalSection = new Bileto\CriticalSection\CriticalSection($driver); $criticalSection->enter('Section Label'); // Perform set of steps of critical tasks $criticalSection->leave('Section Label');