diff --git a/jupyter-server-ioloop-comm.el b/jupyter-server-ioloop-comm.el new file mode 100644 index 0000000..fcb46f4 --- /dev/null +++ b/jupyter-server-ioloop-comm.el @@ -0,0 +1,45 @@ +;;; jupyter-server-ioloop-comm.el --- Async support for Jupyter kernel servers -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Nathaniel Nicandro + +;; Author: Nathaniel Nicandro +;; Created: 11 Mar 2020 + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 3, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Async support for Jupyter kernel servers. Requires ZMQ. + +;;; Code: + +(require 'jupyter-server) +(require 'jupyter-ioloop-comm) +(require 'jupyter-server-ioloop) + +(defgroup jupyter-server-ioloop-comm nil + "Async support for Jupyter kernel servers (requires ZMQ)." + :group 'jupyter) + +(defclass jupyter-server-ioloop-comm (jupyter-server jupyter-ioloop-comm) + ()) + +(defclass jupyter-server-ioloop-kernel-comm (jupyter-server-abstract-kcomm) + ()) + +(provide 'jupyter-server-ioloop-comm) + +;;; jupyter-server-ioloop-comm.el ends here diff --git a/jupyter-server.el b/jupyter-server.el index 1135785..440731a 100644 --- a/jupyter-server.el +++ b/jupyter-server.el @@ -88,6 +88,11 @@ "Support for the Jupyter kernel gateway" :group 'jupyter) +(defcustom jupyter-server-use-zmq (and (locate-library "zmq") t) + "Whether or not ZMQ should be used as a backend." + :type 'boolean + :group 'jupyter) + (defvar-local jupyter-current-server nil "The `jupyter-server' associated with the current buffer. Used in, e.g. a `jupyter-server-kernel-list-mode' buffer.") @@ -159,8 +164,12 @@ Access should be done through `jupyter-available-kernelspecs'."))) ;; The notebook server already takes care of forcing shutdown of a kernel. (ignore)) -(defclass jupyter-server-kernel-comm (jupyter-comm-layer) - ((kernel :type jupyter-server-kernel :initarg :kernel))) +(defclass jupyter-server-abstract-kcomm (jupyter-comm-layer) + ((kernel :type jupyter-server-kernel :initarg :kernel)) + :abstract t) + +(defclass jupyter-server-kernel-comm (jupyter-server-abstract-kcomm) + ()) (cl-defmethod jupyter-comm-id ((comm jupyter-server-kernel-comm)) (let* ((kernel (oref comm kernel))