Commit 3b418494 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

kernels: Add 'kernel-sockets'.

* jupyter/kernels.scm (kernel-sockets): New procedure.
(close-kernel): Use it.
parent 6874b76c
......@@ -40,6 +40,7 @@
kernel-heartbeat
kernel-iosub
kernel-iopub ;alias
kernel-sockets
read-message
send-message
......@@ -82,14 +83,19 @@
(%kernel name pid key
control shell standard-input heartbeat iosub))
(define (kernel-sockets kernel)
"Return all the ZeroMQ sockets associated with KERNEL."
(map (lambda (socket)
(socket kernel))
(list kernel-shell
kernel-control
kernel-standard-input
kernel-heartbeat
kernel-iopub)))
(define (close-kernel kernel)
"Close all the open connections of KERNEL."
(for-each zmq-close-socket
(map (lambda (proc)
(proc kernel))
(list kernel-control kernel-shell
kernel-standard-input
kernel-heartbeat kernel-iopub))))
(for-each zmq-close-socket (kernel-sockets kernel)))
(define (jupyter-kernel-path)
"Return the default search path for Jupyter kernels."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment