为asyncio模块进行猴子补丁以实现预期行为
项目描述
asyncio_monkey
==============
:info: 为asyncio模块进行猴子补丁以实现预期行为
.. 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_monkey
安装
------------
.. code-block:: shell
pip install asyncio_monkey
用法
-----
.. code-block:: python
# 在任何导入asyncio语句之前执行,每个项目一次
# 最好放在您的应用程序的__init__.py中
from asyncio_monkey import patch_all # noqa isort:skip
patch_all()
或调用所需的函数
.. code-block:: python
# 在任何导入asyncio语句之前执行,每个项目一次
# 最好放在您的应用程序的__init__.py中
import asyncio_monkey # noqa isort:skip
asyncio_monkey.patch_gather()
asyncio_monkey.patch_log_destroy_pending()
asyncio_monkey.patch_get_event_loop()
asyncio_monkey.patch_lock()
功能
--------
- 如果任何任务失败,则取消挂起的任务 `gather`,`source <https://bugs.python.org/issue31452>`_
- 禁用 `get_event_loop` 返回当前运行的循环,即使 `MainThread` 循环为 `None`,`docs <https://docs.pythonlang.cn/3/library/asyncio-eventloops.html#asyncio.get_event_loop>`_ ,`source <https://bugs.python.org/issue28613>`_
- 禁用 `asyncio.gather` 内部静默销毁未来对象 `source <https://github.com/python/cpython/blob/3dc7c52a9f4fb83be3e26e31e2c7cd9dc1cb41a2/Lib/asyncio/tasks.py#L600>`_
- 防止取消后 `asyncio.Lock` 死锁 `source <http://bugs.python.org/issue27585>`_
==============
:info: 为asyncio模块进行猴子补丁以实现预期行为
.. 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_monkey
安装
------------
.. code-block:: shell
pip install asyncio_monkey
用法
-----
.. code-block:: python
# 在任何导入asyncio语句之前执行,每个项目一次
# 最好放在您的应用程序的__init__.py中
from asyncio_monkey import patch_all # noqa isort:skip
patch_all()
或调用所需的函数
.. code-block:: python
# 在任何导入asyncio语句之前执行,每个项目一次
# 最好放在您的应用程序的__init__.py中
import asyncio_monkey # noqa isort:skip
asyncio_monkey.patch_gather()
asyncio_monkey.patch_log_destroy_pending()
asyncio_monkey.patch_get_event_loop()
asyncio_monkey.patch_lock()
功能
--------
- 如果任何任务失败,则取消挂起的任务 `gather`,`source <https://bugs.python.org/issue31452>`_
- 禁用 `get_event_loop` 返回当前运行的循环,即使 `MainThread` 循环为 `None`,`docs <https://docs.pythonlang.cn/3/library/asyncio-eventloops.html#asyncio.get_event_loop>`_ ,`source <https://bugs.python.org/issue28613>`_
- 禁用 `asyncio.gather` 内部静默销毁未来对象 `source <https://github.com/python/cpython/blob/3dc7c52a9f4fb83be3e26e31e2c7cd9dc1cb41a2/Lib/asyncio/tasks.py#L600>`_
- 防止取消后 `asyncio.Lock` 死锁 `source <http://bugs.python.org/issue27585>`_
项目详情
关闭
asyncio_monkey-0.1.1.tar.gz的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0743e7852edc3f854eff2c1f3591d965a09e252c587b7d3fe19b5d56b256237e |
|
MD5 | e18c213f1aa98992b2cb0e82e9215289 |
|
BLAKE2b-256 | ec6abf58745119e289cfb399113357b8073d76e150e601c80921621f1729731c |