File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,13 @@ JSON serialised dictionary containing the following keys and values:
132
132
is found, a kernel with a matching `language ` will be used.
133
133
This allows a notebook written on any Python or Julia kernel to be properly associated
134
134
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.
135
142
- **env ** (optional): A dictionary of environment variables to set for the kernel.
136
143
These will be added to the current environment variables before the kernel is
137
144
started.
Original file line number Diff line number Diff line change @@ -959,6 +959,27 @@ Message type: ``shutdown_reply``::
959
959
socket, they simply send a forceful process termination signal, since a dead
960
960
process is unlikely to respond in any useful way to messages.
961
961
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
+
962
983
963
984
Messages on the IOPub (PUB/SUB) channel
964
985
=======================================
You can’t perform that action at this time.
0 commit comments