Commit graph

35 commits

Author SHA1 Message Date
Nathaniel Nicandro
49c2231b24 jupyter-zmq-io: Handle kernel restarts 2023-02-16 08:48:11 -06:00
Nathaniel Nicandro
0a9aeb86bd Silence the byte compiler 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
37c3187f8f jupyter-kernel-process: Handle fatal signals of a kernel process more cleanly
In the process sentinel, only consider the process dying as unexpected
when the process object still has a :kernel property.
2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
97dcb49e46 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.
2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
154ecb48df Add jupyter-connection-file-to-session and use it in process kernels 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
c3f53da945 jupyter-interrupt: Interrupt a process only if it's live 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
aadc3ebc88 Fix port tunneling when connecting to remote kernels 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
86beb065db jupyter-kernel: Move conn-info key handling to "process" :extra method 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
9c9327a17d jupyter-zmq-io: Convert channel to keyword before sending to ioloop 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
abf28f6edc jupyter-zmq-io: Launch kernel before attempting to initialize its I/O 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
e93cb599d2 Fix undefined function 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
ea199e3f77 Fix return value of jupyter-zmq-io 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
11456b4a4a Rename jupyter-kernel-process-io to jupyter-zmq-io 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
c47345f6ec Fix jupyter-kernel method names for jupyter-kernel-process 2023-02-13 20:30:19 -06:00
Nathaniel Nicandro
23b9d03f3e Partially revert "Remove no longer used files"
This partially reverts commit 472d6bf322.
2023-02-13 20:29:35 -06:00
Nathaniel Nicandro
472d6bf322 Remove no longer used files 2023-02-13 20:25:02 -06:00
Nathaniel Nicandro
e133c34707 Add do prefix to launch,shutdown,interrupt functions of a kernel
launch,shutdown,interrupt are now monadic functions.
2023-02-13 20:22:50 -06:00
Nathaniel Nicandro
e6dd933801 jupyter-kernel-process-io 2023-02-13 20:22:50 -06:00
Nathaniel Nicandro
d57eff4fa0 jupyter--kernel-processes: Update documentation 2023-02-13 20:22:50 -06:00
Nathaniel Nicandro
7346571275 Discard I/O connection on shutdown 2023-02-13 20:22:50 -06:00
Nathaniel Nicandro
357cc08856 jupyter-kernel-process.el: Update to use publisher/subscribers 2023-02-13 20:22:50 -06:00
Nathaniel Nicandro
d4d1e1e48c Fix byte compiler warnings for jupyter--kernel-processes 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
d18c41c9af Doc changes on jupyter--kernel-processes 2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
f534172049 Remove jupyter--kernel-died-process-sentinel
Replace with a function passed to `jupyter-launch`

- Getting wrong number of argument errors on the method
- Also mention that the `jupyter-kernel-died` function should have
  been called only when the process status is signal.
2023-02-13 20:22:49 -06:00
Nathaniel Nicandro
874cc9c043 Remove the process slot of a jupyter-kernel-process
Since the `jupyter--kernel-processes` list exists it is redundant.
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
7a52f6240d Update jupyter-kernel-process test 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
140284de80 Re-word doc of jupyter--kernel-processes 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
dc91912d5b Remove duplicated use of jupyter-session-with-random-ports
This is already done in `jupyter-launch`.
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
eba2bcc280 Move initialization of ioloop into the context of the connection 2023-02-13 20:21:14 -06:00
Nathaniel Nicandro
5d6dd04949 Remove duplicated function call
* jupyter-kernel-process.el (jupyter-connection): Do it.
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
a33231b4d3 Rename many methods 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