]> granicus.if.org Git - python/commitdiff
bpo-35465: Document _UnixSelectorEventLoop.add_signal_handler. (GH-11145)
authorHrvoje Nikšić <hniksic@gmail.com>
Tue, 18 Dec 2018 21:31:29 +0000 (22:31 +0100)
committerYury Selivanov <yury@magic.io>
Tue, 18 Dec 2018 21:31:29 +0000 (16:31 -0500)
Doc/library/asyncio-eventloop.rst

index da2339132a403d28da2f1d05ecac8376af70daf4..acf9477f723d4422d9e0edd58edcfae0f8d2cd5d 100644 (file)
@@ -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.