docs/decorators.rst
raw| 1 | .. _decorators: |
| 2 | |
| 3 | Decorators |
| 4 | ========== |
| 5 | |
| 6 | aiocache comes with a couple of decorators for caching results from asynchronous functions. Do not use the decorator in synchronous functions, it may lead to unexpected behavior. |
| 7 | |
| 8 | .. _cached: |
| 9 | |
| 10 | cached |
| 11 | ------ |
| 12 | |
| 13 | .. automodule:: aiocache |
| 14 | :members: cached |
| 15 | |
| 16 | .. literalinclude:: ../examples/cached_decorator.py |
| 17 | :language: python |
| 18 | :linenos: |
| 19 | |
| 20 | .. _multi_cached: |
| 21 | |
| 22 | multi_cached |
| 23 | ------------ |
| 24 | |
| 25 | .. automodule:: aiocache |
| 26 | :members: multi_cached |
| 27 | |
| 28 | .. literalinclude:: ../examples/multicached_decorator.py |
| 29 | :language: python |
| 30 | :linenos: |