1- # malkusch/lock
1+ ** [ Requirements] ( #requirements ) ** |
2+ ** [ Installation] ( #installation ) ** |
3+ ** [ Usage] ( #usage ) **
4+
5+ # php-lock/lock
26
37[ ![ Latest Stable Version] ( https://poser.pugx.org/malkusch/lock/version )] ( https://packagist.org/packages/malkusch/lock )
48[ ![ Total Downloads] ( https://poser.pugx.org/malkusch/lock/downloads )] ( https://packagist.org/packages/malkusch/lock )
812
913This library helps executing critical code in concurrent situations.
1014
15+ php-lock/lock follows semantic versioning. Read more on [ semver.org] [ 1 ] .
16+
17+ ----
18+
19+ ## Requirements
20+ - PHP 7.1 or above
21+ - Optionally [ nrk/predis] ( https://github.com/nrk/predis ) to use the predis locks.
22+ - Optionally the [ php-pcntl] ( http://php.net/manual/en/book.pcntl.php ) extension to enables locking with flock without busy waiting in CLI scripts.
23+
1124----
1225
1326## Installation
1427
1528Use [ Composer] ( https://getcomposer.org/ ) :
1629
1730``` sh
18- composer require malkusch/lock
31+ composer require " malkusch/lock"
1932```
2033
2134## Usage
@@ -248,7 +261,6 @@ $mutex->synchronized(function () use ($pdo, $accountId, $amount) {
248261});
249262```
250263
251-
252264##### MySQLMutex
253265
254266The ** MySQLMutex** uses MySQL's
@@ -275,6 +287,7 @@ $mutex->synchronized(function () use ($bankAccount, $amount) {
275287 $bankAccount->setBalance($balance);
276288});
277289```
290+
278291##### PgAdvisoryLockMutex
279292
280293The ** PgAdvisoryLockMutex** uses PostgreSQL's
@@ -301,14 +314,14 @@ $mutex->synchronized(function () use ($bankAccount, $amount) {
301314});
302315```
303316
304-
305-
306317## License and authors
307318
308319This project is free and under the WTFPL.
309320Responsible for this project is Willem Stuursma-Ruwen
< [email protected] > .
310321
311- ### Donations
322+ ## Donations
312323
313324If you like this project and feel generous donate a few Bitcoins here:
314325[ 1P5FAZ4QhXCuwYPnLZdk3PJsqePbu1UDDA] ( bitcoin:1P5FAZ4QhXCuwYPnLZdk3PJsqePbu1UDDA )
326+
327+ [ 1 ] : http://semver.org/
0 commit comments