Add the jupyter-use-zmq custom variable

This commit is contained in:
Nathaniel Nicandro 2021-02-06 18:14:59 -06:00
parent 6fe02d9e91
commit 6418de7ef5
3 changed files with 26 additions and 14 deletions

View file

@ -63,6 +63,13 @@ messages consider this variable."
(const "error")
(const "stream"))))
(defcustom jupyter-use-zmq (and (locate-library "zmq") t)
"Whether or not ZMQ can be used to communicate with kernels.
If ZMQ is not available for use, kernels can only be launched
from a backing notebook server."
:group 'jupyter
:type 'boolean)
(defconst jupyter-root (file-name-directory load-file-name)
"Root directory containing emacs-jupyter.")

View file

@ -2087,7 +2087,11 @@ command on the host."
(or client-class (setq client-class 'jupyter-repl-client))
(jupyter-error-if-not-client-class-p client-class 'jupyter-repl-client)
(jupyter-bootstrap-repl
(let ((spec (jupyter-kernelspec-name
(jupyter-guess-kernelspec kernel-name))))
(jupyter-client
(if jupyter-use-zmq
(jupyter-kernel :spec spec)
(jupyter-kernel
:server (let ((server jupyter--run-repl-server))
(if (and server
@ -2098,9 +2102,8 @@ command on the host."
(url (format "http://localhost:%s" port)))
(setq jupyter--run-repl-server
(jupyter-server :url url)))))
:spec (jupyter-kernelspec-name
(jupyter-guess-kernelspec kernel-name)))
client-class)
:spec spec))
client-class))
repl-name associate-buffer display))
;;;###autoload

View file

@ -39,6 +39,8 @@
(declare-function jupyter-servers "jupyter-server")
(setq jupyter-use-zmq nil)
;; Increase timeouts when testing for consistency. I think what is going on is
;; that communication with subprocesses gets slowed down when many processes
;; are being open and closed? The kernel processes are cached so they are