Commit graph

105 commits

Author SHA1 Message Date
Nathaniel Nicandro
2f83bfd3ae Use jupyter-message-status-starting-p where appropriate 2018-05-20 11:03:06 -05:00
Nathaniel Nicandro
ccf3633604 Do not rename the connection file after is has been used to start a kernel 2018-05-20 11:02:24 -05:00
Nathaniel Nicandro
94171eba4a Update documentation 2018-05-16 21:54:29 -05:00
Nathaniel Nicandro
1841e49b5d Be consistent with message types
Only use the message symbol's as defined in `jupyter-message-types` and switch
to the string representation only when sending a message.
2018-05-16 20:46:10 -05:00
Nathaniel Nicandro
3b3fe9c43f jupyter-<type> -> jupyter-send-<type> where appropriate 2018-05-16 12:25:57 -05:00
Nathaniel Nicandro
670611ded1 Update code comments and documentation 2018-05-15 16:45:24 -05:00
Nathaniel Nicandro
fc665655f8 Remove jupyter-connection
To make up for this:
- Move the functions defined in `jupyter-connection.el` to `jupyter-base.el`
- Add a `session` field to the `jupyter-kernel-manager` and `jupyter-channel`
  classes
- Add a `kernel-info` field to the `jupyter-repl-client`
- Add a `conn-info` field to a `jupyter-session`
- Add a `session` field to `jupyter-kernel-client`
2018-05-15 16:45:24 -05:00
Nathaniel Nicandro
bcd45b6db4 Tiny refactors/optimizations 2018-05-13 12:11:08 -05:00
Nathaniel Nicandro
ef69521202 Update documentation and comments 2018-02-12 11:06:09 -06:00
Nathaniel Nicandro
86be51eb72 Don't rely on the event string in a process sentinel 2018-02-09 17:23:46 -06:00
Nathaniel Nicandro
83881bf4e0 Ensure the startup message is caught
Setup the necessary hooks before starting the kernel so that we can ensure that
the startup message is caught.

A short delay is also added whenever we start a channel. This was necessary for
the client to catch the startup message of a python kernel.
2018-02-07 12:08:07 -06:00
Nathaniel Nicandro
aa054178b7 Refactor jupyter-start-new-kernel 2018-02-03 19:06:10 -06:00
Nathaniel Nicandro
43a59ba74d Update channel implementation
- Distinguish between an asynchronous channel and a synchronous one

  - `jupyter-async-channel` :: Messages are sent and received through an ioloop
                               subprocess that the channel has access to. The
                               subprocess uses the `jupyter-sync-channel` for
                               sending and receiving messages.

  - `jupyter-sync-channel` :: Messages are sent and received through a
                               `zmq-socket` in the current Emacs session.

  - Define `jupyter-send` and `jupyter-recv` methods for channels.

  - Update `jupyter-kernel-client` and ioloop interfaces to take into account
    changes with channels.
2018-02-03 19:06:10 -06:00
Nathaniel Nicandro
0504bf36e0 Update documentation and comments 2018-02-03 19:06:10 -06:00
Nathaniel Nicandro
341214f5a9 Add documentation 2018-01-22 19:21:44 -06:00
Nathaniel Nicandro
51e48545a6 Fix use of progress reporter 2018-01-22 18:36:00 -06:00
Nathaniel Nicandro
c7a4874222 Only attempt to start a kernel when it is not already started 2018-01-22 18:35:25 -06:00
Nathaniel Nicandro
d41751575a Re-emit error when kernel fails to start 2018-01-21 01:06:29 -06:00
Nathaniel Nicandro
7267577de0 Take into account changes in kernelspec code 2018-01-20 23:13:04 -06:00
Nathaniel Nicandro
43d5d4a8c9 Use cl-defgeneric for jupyter-kernel-manager methods
Also cleanup documentation
2018-01-18 23:00:31 -06:00
Nathaniel Nicandro
6934118012 Add progress reporters when starting a kernel 2018-01-18 22:47:18 -06:00
Nathaniel Nicandro
de635fdc3a Add customizable jupyter-runtime-directory variable
- Also fix the handling of `resource_dir` in a kernelspec argument vector
2018-01-18 22:45:17 -06:00
Nathaniel Nicandro
f27fad472b Add documentation to jupyter-kernel-manager slots 2018-01-18 22:43:52 -06:00
Nathaniel Nicandro
fc052d3baf jupyter-connection objects have a kernel-info slot
This allows the kernel info to be shared between a kernel manager and the
clients that have the manager as its parent instance.
2018-01-18 21:14:27 -06:00
Nathaniel Nicandro
e457ecbfa7 Add object destructors for jupyter-kernel-manager and jupyter-kernel-client
These are used when an object definately needs to be destroyed. They are needed
to cleanup resources like processes and internal buffers.
2018-01-18 16:06:22 -06:00
Nathaniel Nicandro
d0257740bb Simplify variable names 2018-01-17 20:37:34 -06:00
Nathaniel Nicandro
e4c3088749 Add jupyter-inhibit-handlers
This removes the need for `jupyter-request-inhibit-handlers`
2018-01-17 20:34:32 -06:00
Nathaniel Nicandro
f302445ac2 Handle more failure cases when starting a new kernel 2018-01-16 11:52:26 -06:00
Nathaniel Nicandro
9b66532f94 Use message instead of warn 2018-01-16 11:52:10 -06:00
Nathaniel Nicandro
5864e855e3 Add a buffer to the kernel process
This allows for looking at the kernel stdout
2018-01-16 11:51:16 -06:00
Nathaniel Nicandro
20f9ea2643 Do proper cleanup when kernel startup fails
- `jupyter-shutdown-kernel` assumes that the kernel is able to be communicated
  with, but when startup fails we know its not so just delete the process
  immediately.

- When deleting the connection info file after a kernel dies, make sure that
  the file exists first.
2018-01-14 13:54:02 -06:00
Nathaniel Nicandro
fd89b419a7 Better predicate in jupyter-kernel-alive-p 2018-01-13 22:11:09 -06:00
Nathaniel Nicandro
060340625e Properly cleanup if jupyter-start-kernel fails in jupyter-start-new-kernel 2018-01-13 22:10:38 -06:00
Nathaniel Nicandro
3e57114a18 Code style and remove completed TODO 2018-01-13 22:10:18 -06:00
Nathaniel Nicandro
dc4c9f7a66 Allow restarting the kernel after shutdown in jupyter-shutdown-kernel 2018-01-13 22:08:14 -06:00
Nathaniel Nicandro
80dd6a51e8 Fix jupyter--kernel-sentinel
- `jupyter-stop-channels` is already called in `jupyter-shutdown-kernel`
- Don't delete connection info when kernel dies because it can be restarted.
2018-01-13 22:06:41 -06:00
Nathaniel Nicandro
865db23f28 Set the process sentinel in jupyter--start-kernel 2018-01-13 22:04:06 -06:00
Nathaniel Nicandro
710d4125b5 Update documentation and comments 2018-01-13 13:40:32 -06:00
Nathaniel Nicandro
d67883d9f5 Use unwind-protect instead of condition-case 2018-01-13 13:36:15 -06:00
Nathaniel Nicandro
a5d188e32f Move jupyter-wait-until-startup to jupyter-kernel-manager.el
Also make `jupyter-wait-until-startup` private by renaming to
`jupyter--wait-until-startup`. Startup messages are only sent once at kernel
startup, since the only way to start a kernel is through a
`jupyter-kernel-manager` it makes more sense to only allow a kernel manager to
wait for a startup message.
2018-01-12 18:14:04 -06:00
Nathaniel Nicandro
1760d4942b Remove unused variable 2018-01-12 18:10:11 -06:00
Nathaniel Nicandro
ce9321be09 Add timeout when starting a kernel 2018-01-12 18:09:30 -06:00
Nathaniel Nicandro
af82c55b1c Introduce jupyter-wait-until-startup 2018-01-11 12:14:35 -06:00
Nathaniel Nicandro
c86ab40514 Fix no method found error in jupyter-shutdown-kernel 2018-01-11 12:13:33 -06:00
Nathaniel Nicandro
a7539dc37b Fix checkdoc warnings 2018-01-09 00:44:34 -06:00
Nathaniel Nicandro
c7dee4aa55 Simplify kernel shutdown and interruptions in a kernel manager 2018-01-09 00:44:34 -06:00
Nathaniel Nicandro
d44d9d0c64 Actually set the kernel process of a manager when starting the kernel 2018-01-09 00:44:34 -06:00
Nathaniel Nicandro
14e02c95bf Handle {resource_dir} when starting kernel 2018-01-09 00:44:34 -06:00
Nathaniel Nicandro
326ff15d92 Add standard header comments 2018-01-09 00:44:33 -06:00
Nathaniel Nicandro
ebd616998e Add/update lots of documentation 2018-01-09 00:44:33 -06:00