Skip to content

Commit 0c0b296

Browse files
committed
upd readme
1 parent c692448 commit 0c0b296

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

CONTRIBUTORS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Acknowledgements
2+
----------------
3+
Andrew Svetlov https://github.com/asvetlov

README.rst

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ being exclusively locked and there is little, if any increase in concurrency.
2121

2222
Implementation almost direct port from this patch_.
2323

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

3025
Example
3126
-------
@@ -51,6 +46,26 @@ Example
5146
5247
loop.run_until_complete(go())
5348
49+
Note
50+
----
51+
52+
You have to use ``try/finally`` pattern, it is not possible to build
53+
*context manager* for this lock since, ``yield from`` is necessary for
54+
``release()`` method.
55+
56+
.. code:: python
57+
58+
yield from rwlock.writer_lock.acquire()
59+
try:
60+
yield from do_work()
61+
finally:
62+
yield from rwlock.writer_lock.release()
63+
64+
License
65+
-------
66+
67+
``aiorwlock`` is offered under the Apache 2 license.
68+
5469

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

0 commit comments

Comments
 (0)