diff options
author | Hrvoje Nikšić <hniksic@gmail.com> | 2018-12-18 21:31:29 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2018-12-18 21:31:29 (GMT) |
commit | e3666fc8effb05b555121f4ab7388df59e21f8b4 (patch) | |
tree | fc678cc108ec9122c0a0a80c201351ebce10fef0 /Doc | |
parent | d2a75c67830d7c9f59e4e9b60f36974234c829ef (diff) | |
download | cpython-e3666fc8effb05b555121f4ab7388df59e21f8b4.zip cpython-e3666fc8effb05b555121f4ab7388df59e21f8b4.tar.gz cpython-e3666fc8effb05b555121f4ab7388df59e21f8b4.tar.bz2 |
bpo-35465: Document _UnixSelectorEventLoop.add_signal_handler. (GH-11145)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index da23391..acf9477 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -966,12 +966,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. |