Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added php client link

  • Loading branch information...
commit bf303abdfb631f5c11819b0bbbbc496d7b91f073 1 parent 7d2e48b
Ian Babrou authored
Showing with 24 additions and 1 deletion.
  1. +24 −1 README.md
25 README.md
View
@@ -18,7 +18,7 @@ This is lock server for system that need to share and lock common resources acro
[Client for node.js](https://github.com/bobrik/node-locker) is completely async.
-Example
+Example:
```javascript
var Locker = require("locker"),
@@ -46,6 +46,29 @@ locker.locked("five", 2000, 3000, function(error, callback) {
});
```
+### PHP
+
+[Client for php](https://github.com/bobrik/php-locker).
+
+Example:
+
+```php
+require_once('Locker.php');
+
+$Locker = new \Locker\Locker("127.0.0.1", 4545);
+
+// Lock creation
+$LockOne = $Locker->createLock('example');
+
+// getting lock
+$LockOne->acquire(200, 10000);
+// doing very important stuff
+echo 'Waiting for 5 seconds..'."\n";
+sleep(5);
+// releasing lock
+$LockOne->release();
+```
+
## Running
First create a dir for locker:
Please sign in to comment.
Something went wrong with that request. Please try again.