Skip to content

Commit

Permalink
upd readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jettify committed Dec 22, 2014
1 parent c692448 commit 0c0b296
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Acknowledgements
----------------
Andrew Svetlov https://github.com/asvetlov
25 changes: 20 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ being exclusively locked and there is little, if any increase in concurrency.

Implementation almost direct port from this patch_.

You have to use ``try/finally`` pattern, it is not possible to build
context manager for this lock since, ``yield from`` is necessary for
``release()`` method.



Example
-------
Expand All @@ -51,6 +46,26 @@ Example
loop.run_until_complete(go())
Note
----

You have to use ``try/finally`` pattern, it is not possible to build
*context manager* for this lock since, ``yield from`` is necessary for
``release()`` method.

.. code:: python
yield from rwlock.writer_lock.acquire()
try:
yield from do_work()
finally:
yield from rwlock.writer_lock.release()
License
-------

``aiorwlock`` is offered under the Apache 2 license.


.. _asyncio: http://docs.python.org/3.4/library/asyncio.html
.. _patch: http://bugs.python.org/issue8800

0 comments on commit 0c0b296

Please sign in to comment.