Skip to content

Commit f0e33ba

Browse files
committed
Update docs.
1 parent 172d6cd commit f0e33ba

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/kernels.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ JSON serialised dictionary containing the following keys and values:
132132
is found, a kernel with a matching `language` will be used.
133133
This allows a notebook written on any Python or Julia kernel to be properly associated
134134
with the user's Python or Julia kernel, even if they aren't listed under the same name as the author's.
135+
- **interrupt_mode** (optional): May be either ``signal`` or ``message`` and
136+
specifies how a client is supposed to interrupt cell execution on this kernel,
137+
either by sending an interrupt ``signal`` via the operating system's
138+
signalling facilities (e.g. `SIGTERM` on POSIX systems), or by sending an
139+
``interrupt_request`` message on the control channel (see
140+
:ref:`msging_interrupt`). If this is not specified
141+
the client will default to ``signal`` mode.
135142
- **env** (optional): A dictionary of environment variables to set for the kernel.
136143
These will be added to the current environment variables before the kernel is
137144
started.

docs/messaging.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,27 @@ Message type: ``shutdown_reply``::
959959
socket, they simply send a forceful process termination signal, since a dead
960960
process is unlikely to respond in any useful way to messages.
961961

962+
.. _msging_interrupt:
963+
964+
Kernel interrupt
965+
----------------
966+
967+
In case a kernel can not catch operating system interrupt signals (e.g. the used
968+
runtime handles signals and does not allow a user program to define a callback),
969+
a kernel can choose to be notified using a message instead. For this to work,
970+
the kernels kernelspec must set `interrupt_mode` to ``message``. An interruption
971+
will then result in the following message on the `control` channel:
972+
973+
Message type: ``interrupt_request``::
974+
975+
content = {}
976+
977+
Message type: ``interrupt_reply``::
978+
979+
content = {}
980+
981+
.. versionadded:: 5.3
982+
962983

963984
Messages on the IOPub (PUB/SUB) channel
964985
=======================================

0 commit comments

Comments
 (0)