@@ -15,7 +15,7 @@ msgid ""
1515msgstr ""
1616"Project-Id-Version : Python 3.8\n "
1717"Report-Msgid-Bugs-To : \n "
18- "POT-Creation-Date : 2020-06-23 14:18 +0000\n "
18+ "POT-Creation-Date : 2020-09-05 14:59 +0000\n "
1919"PO-Revision-Date : 2020-05-30 11:56+0000\n "
2020"
Last-Translator :
Freesand Leo <[email protected] >, 2020\n "
2121"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -189,19 +189,32 @@ msgstr ""
189189":class:`concurrent.futures.ThreadPoolExecutor` "
190190"一起使用,用于在一个不同的操作系统线程中执行阻塞代码,并避免阻塞运行事件循环的那个操作系统线程。"
191191
192- #: ../../library/asyncio-dev.rst:114
192+ #: ../../library/asyncio-dev.rst:110
193+ msgid ""
194+ "There is currently no way to schedule coroutines or callbacks directly from "
195+ "a different process (such as one started with :mod:`multiprocessing`). The "
196+ ":ref:`Event Loop Methods <asyncio-event-loop>` section lists APIs that can "
197+ "read from pipes and watch file descriptors without blocking the event loop. "
198+ "In addition, asyncio's :ref:`Subprocess <asyncio-subprocess>` APIs provide a"
199+ " way to start a process and communicate with it from the event loop. Lastly,"
200+ " the aforementioned :meth:`loop.run_in_executor` method can also be used "
201+ "with a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a "
202+ "different process."
203+ msgstr ""
204+
205+ #: ../../library/asyncio-dev.rst:124
193206msgid "Running Blocking Code"
194207msgstr "运行阻塞的代码"
195208
196- #: ../../library/asyncio-dev.rst:116
209+ #: ../../library/asyncio-dev.rst:126
197210msgid ""
198211"Blocking (CPU-bound) code should not be called directly. For example, if a "
199212"function performs a CPU-intensive calculation for 1 second, all concurrent "
200213"asyncio Tasks and IO operations would be delayed by 1 second."
201214msgstr ""
202215"不应该直接调用阻塞( CPU 绑定)代码。例如,如果一个函数执行1秒的 CPU 密集型计算,那么所有并发异步任务和 IO 操作都将延迟1秒。"
203216
204- #: ../../library/asyncio-dev.rst:121
217+ #: ../../library/asyncio-dev.rst:131
205218msgid ""
206219"An executor can be used to run a task in a different thread or even in a "
207220"different process to avoid blocking the OS thread with the event loop. See "
@@ -210,27 +223,27 @@ msgstr ""
210223"可以用执行器在不同的线程甚至不同的进程中运行任务,以避免使用事件循环阻塞 OS 线程。 请参阅 :meth:`loop.run_in_executor`"
211224" 方法了解详情。"
212225
213- #: ../../library/asyncio-dev.rst:130
226+ #: ../../library/asyncio-dev.rst:140
214227msgid "Logging"
215228msgstr "日志记录"
216229
217- #: ../../library/asyncio-dev.rst:132
230+ #: ../../library/asyncio-dev.rst:142
218231msgid ""
219232"asyncio uses the :mod:`logging` module and all logging is performed via the "
220233"``\" asyncio\" `` logger."
221234msgstr "asyncio使用 :mod:`logging` 模块,所有日志记录都是通过 ``\" asyncio\" `` logger执行的。"
222235
223- #: ../../library/asyncio-dev.rst:135
236+ #: ../../library/asyncio-dev.rst:145
224237msgid ""
225238"The default log level is :py:data:`logging.INFO`, which can be easily "
226239"adjusted::"
227240msgstr "默认日志级别是 :py:data:`logging.INFO` 。可以很容易地调整::"
228241
229- #: ../../library/asyncio-dev.rst:144
242+ #: ../../library/asyncio-dev.rst:154
230243msgid "Detect never-awaited coroutines"
231244msgstr "检测 never-awaited 协同程序"
232245
233- #: ../../library/asyncio-dev.rst:146
246+ #: ../../library/asyncio-dev.rst:156
234247msgid ""
235248"When a coroutine function is called, but not awaited (e.g. ``coro()`` "
236249"instead of ``await coro()``) or the coroutine is not scheduled with "
@@ -239,25 +252,25 @@ msgstr ""
239252"当协程函数被调用而不是被等待时 (即执行 ``coro()`` 而不是 ``await coro()``) 或者协程没有通过 "
240253":meth:`asyncio.create_task` 被排入计划日程,asyncio 将会发出一条 :exc:`RuntimeWarning`::"
241254
242- #: ../../library/asyncio-dev.rst:161 ../../library/asyncio-dev.rst:206
255+ #: ../../library/asyncio-dev.rst:171 ../../library/asyncio-dev.rst:216
243256msgid "Output::"
244257msgstr "输出::"
245258
246- #: ../../library/asyncio-dev.rst:166 ../../library/asyncio-dev.rst:222
259+ #: ../../library/asyncio-dev.rst:176 ../../library/asyncio-dev.rst:232
247260msgid "Output in debug mode::"
248261msgstr "调试模式的输出::"
249262
250- #: ../../library/asyncio-dev.rst:179
263+ #: ../../library/asyncio-dev.rst:189
251264msgid ""
252265"The usual fix is to either await the coroutine or call the "
253266":meth:`asyncio.create_task` function::"
254267msgstr "通常的修复方法是等待协程或者调用 :meth:`asyncio.create_task` 函数::"
255268
256- #: ../../library/asyncio-dev.rst:187
269+ #: ../../library/asyncio-dev.rst:197
257270msgid "Detect never-retrieved exceptions"
258271msgstr "检测就再也没异常"
259272
260- #: ../../library/asyncio-dev.rst:189
273+ #: ../../library/asyncio-dev.rst:199
261274msgid ""
262275"If a :meth:`Future.set_exception` is called but the Future object is never "
263276"awaited on, the exception would never be propagated to the user code. In "
@@ -267,11 +280,11 @@ msgstr ""
267280"如果调用 :meth:`Future.set_exception` ,但不等待 Future 对象,将异常传播到用户代码。在这种情况下,当 Future"
268281" 对象被垃圾收集时,asyncio将发出一条日志消息。"
269282
270- #: ../../library/asyncio-dev.rst:194
283+ #: ../../library/asyncio-dev.rst:204
271284msgid "Example of an unhandled exception::"
272285msgstr "未处理异常的例子::"
273286
274- #: ../../library/asyncio-dev.rst:217
287+ #: ../../library/asyncio-dev.rst:227
275288msgid ""
276289":ref:`Enable the debug mode <asyncio-debug-mode>` to get the traceback where"
277290" the task was created::"
0 commit comments