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-06-29 05:05:01 UTC
README
Critical Sections for PHP ![Build Status](https://camo.githubusercontent.com/ddbc773a8c156e15c6973a00b27563197402d8255f31f5be71ff0eea00cebfad/68747470733a2f2f7472617669732d63692e6f72672f62696c65746f2f437269746963616c53656374696f6e2e7376673f6272616e63683d6d6173746572)
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');