Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hellysmile/asyncio_monkey
monkey patch asyncio modules for expected behaviour
https://github.com/hellysmile/asyncio_monkey
asyncio monkey-patching
Last synced: about 1 month ago
JSON representation
monkey patch asyncio modules for expected behaviour
- Host: GitHub
- URL: https://github.com/hellysmile/asyncio_monkey
- Owner: hellysmile
- License: mit
- Created: 2017-05-12T08:48:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-21T18:59:24.000Z (about 3 years ago)
- Last Synced: 2024-11-25T01:32:26.654Z (2 months ago)
- Topics: asyncio, monkey-patching
- Language: Python
- Homepage: https://pypi.python.org/pypi/asyncio_monkey
- Size: 20.5 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
asyncio_monkey
==============:info: monkey patch asyncio modules for expected behaviour
.. image:: https://img.shields.io/travis/wikibusiness/asyncio_monkey.svg
:target: https://travis-ci.org/wikibusiness/asyncio_monkey.. image:: https://img.shields.io/pypi/v/asyncio_monkey.svg
:target: https://pypi.python.org/pypi/asyncio_monkeyInstallation
------------.. code-block:: shell
pip install asyncio_monkey
Usage
-----.. code-block:: python
# it must be done before any import asyncio statement, once per project
# best place is __init__.py of You'r application
from asyncio_monkey import patch_all # noqa isort:skip
patch_all()or call the one you need
.. code-block:: python
# it must be done before any import asyncio statement, once per project
# best place is __init__.py of You'r application
import asyncio_monkey # noqa isort:skipasyncio_monkey.patch_gather()
asyncio_monkey.patch_log_destroy_pending()
asyncio_monkey.patch_get_event_loop()
asyncio_monkey.patch_lock()Features
--------- Cancel pending tasks `gather` if any task fails, `source `_
- Disables `get_event_loop` returns currently running loop, even if `MainThread` loop is `None`, `docs `_ , `source `_
- Disables silent destroying futures inside `asyncio.gather` `source `_
- Prevents `asyncio.Lock` deadlock after cancellation `source `_