- `jupyter-client.el` only contains client related code
- `jupyter-kernel-manager` related code is placed in `jupyter-kernel-manager.el`
- Socket creating functions and generating connection info plist function are
placed in `jupyter-connection.el`. This also contains the
`jupyter-connection` class.
- Kernelspec related functions are placed in `jupyter-kernelspec.el`
- Move general utility functions and variables requires necessary for `jupyter`
into `jupyter-base.el`. This also contains the `jupyter-session` and
`jupyter-request` struct definitions.
Specifically the REPL is always initialized with a new prompt due to
`jupyter-repl-update-execution-counter` being called as the final step in REPL
initialization. This means that there is no need to catch a
`beginning-of-buffer` error in `jupyter-repl-ret`.
Also remove the need for the `code` variable, just use `jupyter-repl-cell-code`
directly in the `jupyter-is-complete-request`.
This avoids problems with a reply message and a status idle message being
received at identical times for a request. Two messages can be received at the
same time when the fractional seconds resolution of the time stamps received
from the kernel are not high enough. If the iopub channel had a higher priority
it would mean that the idle message would be received before the reply when
they have identical time stamps. Since request objects are removed from the
client when an idle message is received this would prevent any reply callbacks
from running.
To combat this problem, prioritize the shell messages over any other type of
message.
- Introduce `run-handlers-p` for `jupyter-request` objects. When this field is
non-nil, a clients `jupyter-handle-message` method will pass the message to
the channels `jupyter-handle-message` after running any callbacks. Otherwise
the channel handlers will not be run. This gives a way to suppress the
channel handlers for a request.
- Also remove the use of `jupyter-callback` since `jupyter-handle-message` for
a client just removes requests when an idle message is received. The callback
object was used to check if a callback actually ran.
This method dispatches to the appropriate message handlers based on the type of
channel passed to `jupyter-handle-message`. This method is also defined for a
`jupyter-kernel-client` in which case any callbacks for a message will be run
and then the message passed to the channel handlers.
- Only modify/access the `:jupyter-pending-requests' property of the ioloop
subprocess through `jupyter--ioloop-pop-request' and
`jupyter--ioloop-push-request'
- Push a message into a channels receive queue using
`jupyter-channel-push-message'
Where `jupyter-request-*` are the `jupyter-kernel-client` request methods. This
required the underlying messages request message functions to be renamed to
`jupyter-message-*-request` from `jupyter-*-request`.