Permalink
Browse files

added python example code

  • Loading branch information...
1 parent dcd392e commit e3a23af0efe1bf6bfff95f28e579da4229188f8b @bobrik committed Jun 16, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 README.md
View
@@ -69,6 +69,27 @@ sleep(5);
$LockOne->release();
```
+### Python
+
+[Client for python](https://github.com/bobrik/pylocker)
+
+Example:
+
+```python
+from pylocker import Locker
+
+# create locker server connection
+locker = Locker("127.0.0.1", 4545)
+
+# create lock object with some nice name
+lock = locker.create_lock("fuu")
+# acquire lock, wait for it for 500ms if it's taken
+lock.acquire(500, 200)
+# do whatever you need for up to 200ms
+# and release lock
+lock.release()
+```
+
## Running
First create a dir for locker:

0 comments on commit e3a23af

Please sign in to comment.