mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
jupyter-kernel-process: Add connect-p
slot
This is used to distinguish between a connection made to an already existing kernel vs one that is launched by us.
This commit is contained in:
parent
ded0306403
commit
97dcb49e46
2 changed files with 11 additions and 4 deletions
|
@ -53,7 +53,8 @@ exist are deleted.")
|
|||
;;; Kernel definition
|
||||
|
||||
(cl-defstruct (jupyter-kernel-process
|
||||
(:include jupyter-kernel)))
|
||||
(:include jupyter-kernel))
|
||||
connect-p)
|
||||
|
||||
(cl-defmethod jupyter-process ((kernel jupyter-kernel-process))
|
||||
"Return the process of KERNEL.
|
||||
|
@ -111,8 +112,10 @@ Call the next method if ARGS does not contain a :spec or
|
|||
;;; Client connection
|
||||
|
||||
(cl-defmethod jupyter-zmq-io ((kernel jupyter-kernel-process))
|
||||
(jupyter-launch kernel)
|
||||
(let* ((session (jupyter-kernel-session kernel))
|
||||
(unless (jupyter-kernel-process-connect-p kernel)
|
||||
(jupyter-launch kernel))
|
||||
(let* ((session (or (jupyter-kernel-session kernel)
|
||||
(error "A session is needed to connect to a kernel's I/O")))
|
||||
(channels '(:shell :iopub :stdin))
|
||||
(ch-group (let ((endpoints (jupyter-session-endpoints session)))
|
||||
(cl-loop
|
||||
|
|
|
@ -2139,7 +2139,11 @@ like the symbol `jupyter-repl-client', which is the default. "
|
|||
(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 :conn-info file) client-class)
|
||||
(jupyter-client
|
||||
(jupyter-kernel
|
||||
:conn-info file
|
||||
:connect-p t)
|
||||
client-class)
|
||||
repl-name associate-buffer display))
|
||||
|
||||
(provide 'jupyter-repl)
|
||||
|
|
Loading…
Add table
Reference in a new issue