.. currentmodule:: asyncio
The :mod:`asyncio` module is designed to be portable, but some platforms have subtle differences and limitations due to the platforms' underlying architecture and capabilities.
Source code: :source:`Lib/asyncio/proactor_events.py`, :source:`Lib/asyncio/windows_events.py`, :source:`Lib/asyncio/windows_utils.py`
.. versionchanged:: 3.8 On Windows, :class:`ProactorEventLoop` is now the default event loop.
All event loops on Windows do not support the following methods:
:class:`SelectorEventLoop` has the following limitations:
:class:`ProactorEventLoop` has the following limitations:
The resolution of the monotonic clock on Windows is usually around 15.6 msec. The best resolution is 0.5 msec. The resolution depends on the hardware (availability of Subprocess Support on Windows
On Windows, the default event loop :class:`ProactorEventLoop` supports subprocesses, whereas :class:`SelectorEventLoop` does not.
The :meth:`policy.set_child_watcher() <AbstractEventLoopPolicy.set_child_watcher>` function is also not supported, as :class:`ProactorEventLoop` has a different mechanism to watch child processes.
Modern macOS versions are fully supported.
macOS <= 10.8
On macOS 10.6, 10.7 and 10.8, the default event loop uses :class:`selectors.KqueueSelector`, which does not support character devices on these versions. The :class:`SelectorEventLoop` can be manually configured to use :class:`~selectors.SelectSelector` or :class:`~selectors.PollSelector` to support character devices on these older versions of macOS. Example:
import asyncio import selectors selector = selectors.SelectSelector() loop = asyncio.SelectorEventLoop(selector) asyncio.set_event_loop(loop)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。