mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Add the jupyter-use-zmq
custom variable
This commit is contained in:
parent
6fe02d9e91
commit
6418de7ef5
3 changed files with 26 additions and 14 deletions
|
@ -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.")
|
||||
|
||||
|
|
|
@ -2087,20 +2087,23 @@ 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
|
||||
(jupyter-client
|
||||
(jupyter-kernel
|
||||
:server (let ((server jupyter--run-repl-server))
|
||||
(if (and server
|
||||
(process-live-p
|
||||
(jupyter-notebook-process server)))
|
||||
server
|
||||
(let* ((port (jupyter-launch-notebook))
|
||||
(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)
|
||||
(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
|
||||
(process-live-p
|
||||
(jupyter-notebook-process server)))
|
||||
server
|
||||
(let* ((port (jupyter-launch-notebook))
|
||||
(url (format "http://localhost:%s" port)))
|
||||
(setq jupyter--run-repl-server
|
||||
(jupyter-server :url url)))))
|
||||
:spec spec))
|
||||
client-class))
|
||||
repl-name associate-buffer display))
|
||||
|
||||
;;;###autoload
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue