[Python-checkins] bpo-35465: Document _UnixSelectorEventLoop.add_signal_handler. (GH-11145) (GH-11221)

Yury Selivanov webhook-mailer at python.org
Tue Dec 18 16:52:41 EST 2018


https://github.com/python/cpython/commit/12f3979b3807b448ca070b44bbc1597cf800f8a4
commit: 12f3979b3807b448ca070b44bbc1597cf800f8a4
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Yury Selivanov <yury at magic.io>
date: 2018年12月18日T16:52:37-05:00
summary:
bpo-35465: Document _UnixSelectorEventLoop.add_signal_handler. (GH-11145) (GH-11221)
(cherry picked from commit e3666fc8effb05b555121f4ab7388df59e21f8b4)
Co-authored-by: Hrvoje Nikšić <hniksic at gmail.com>
files:
M Doc/library/asyncio-eventloop.rst
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index 647b7fc5e7a5..d59cf055b614 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -960,12 +960,20 @@ Unix signals
 
 Set *callback* as the handler for the *signum* signal.
 
+ The callback will be invoked by *loop*, along with other queued callbacks
+ and runnable coroutines of that event loop. Unlike signal handlers
+ registered using :func:`signal.signal`, a callback registered with this
+ function is allowed to interact with the event loop.
+
 Raise :exc:`ValueError` if the signal number is invalid or uncatchable.
 Raise :exc:`RuntimeError` if there is a problem setting up the handler.
 
 Use :func:`functools.partial` :ref:`to pass keyword arguments
 <asyncio-pass-keywords>` to *callback*.
 
+ Like :func:`signal.signal`, this function must be invoked in the main
+ thread.
+
 .. method:: loop.remove_signal_handler(sig)
 
 Remove the handler for the *sig* signal.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /