Commit graph

16 commits

Author SHA1 Message Date
Nathaniel Nicandro
e6ef8bb672 Fix unused lexical variable 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
9a1321f35d Fix undefined function 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
9519daa105 Document jupyter-server-kernel 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
b98b6bc5d8 Use the 'auth-headers action 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
7fa06ca5f9 Doc and comments 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
4c2752ef3b Add jupyter-run-handlers macro 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
c30d2effaa Make the server slot of a jupyter-server-kernel read-only 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
4abf0d0714 Cleanup whitespace 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
9b2a66868a IO function and connections 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
754f3ed5ff Use jupyter-connection for jupyter-server-kernel objects
This fixes errors with jupyter--send being defined
2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
705462c35d Remove the need to start a connection before sending a message 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
9df6d01070 Move ioloop synchronization into server conn object 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
82e5a0fbc2 Remove jupyter-server-kernel-connected-p
This was mainly used when having to refresh the websocket connections
to a server after a REST request.  Refreshing the websocket
connections is now handled internally to the connection of a
`jupyter-server`.

* jupyter-server-kernel.el
(initialize-instance): Add `kernel-ids` variable, modify it when
connecting/disconnecting kernel channels to the server's websocket
connections.  When starting the subprocess that handles websocket
connections, re-connect any previously connected kernels.
(jupyter-server--refresh-comm): Remove.
(jupyter-server-kernel-connected-p): Remove.
(jupyter-api-request): Use `jupyter-start`/`jupyter-stop` when
refreshing websocket connections.
(jupyter-server--connect-channels): Use `jupyter-ioloop-wait-until`.
(jupyter-connection): Remove `jupyter-server-kernel-connected-p`
call.
2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
5049cdf9ed jupyter-server-kernel.el organization
Also add missing `jupyter-connection` require.
2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
f2c9d5fb25 Convert jupyter-kernel into a method
* jupyter-kernel-process.el
* jupyter-server-kernel.el (jupyter-kernel): New method.

* jupyter-kernel.el (jupyter-kernel): Convert.  Load files that handle
  keywords and re-dispatch when ARGS does not have any connection
  info.  Document behavior.

* test/test-helper.el (jupyter-test-with-kernel-client)
* jupyter-server.el
(jupyter-connect-server-repl)
(jupyter-server-start-new-kernel): Use `jupyter-kernel`.
2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
95f3e150b4 Add jupyter-kernel.el and related
The new files added in this commit will eventually replace the manager
and kernel classes and favor struct types to represent kernels instead
of classes.  A kernel manager was a concept ripped from the
jupyter/jupyter_client reference implementation.

In Emacs the concept makes the client implementation more complicated
and is replaced by functions that manage the lifetime of a kernel:
`jupyter-launch`, `jupyter-shutdown`, and `jupyter-interrupt`.

* jupyter-kernel-manager.el
* jupyter-kernel-process-manager.el
* jupyter-server.el
* test/jupyter-server-test.el
* test/test-helper.el: Make `jupyter-kernel`, `jupyter-server-kernel`,
  and `jupyter-kernel-process` private classes.  The new files below
  use the public names, but as structs now.

* jupyter-kernel.el
* jupyter-kernel-process.el
* jupyter-server-kernel.el: New files.
2023-02-13 20:21:14 -06:00