Commit graph

25 commits

Author SHA1 Message Date
Nathaniel Nicandro
9ddec6c469 Decode date fields into time objects in jupyter--decode 2018-05-05 23:16:01 -05:00
Nathaniel Nicandro
24eb475443 Cleanup comments 2018-02-12 10:25:13 -06:00
Nathaniel Nicandro
255247788c Remove uses of seq functions
Since this is an emacs 25 dependency and there were not many uses of these
functions, remove them.
2018-02-09 09:11:57 -06:00
Nathaniel Nicandro
3170a2305f Add documentation for jupyter-message convenience functions 2018-01-18 23:02:24 -06:00
Nathaniel Nicandro
5d9244b17b Rename jupyter--encode-object -> jupyter--encode, jupyter-decode-string -> jupyter--decode` 2018-01-09 00:44:35 -06:00
Nathaniel Nicandro
a7539dc37b Fix checkdoc warnings 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
b3b1066624 Re-organization of code base
- `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.
2018-01-06 19:55:45 -06:00
Nathaniel Nicandro
b4a5ea177f Use defsubst for the functions that work with message plists
Also add more convenience functions for working with messages.
2018-01-02 13:50:24 -06:00
Nathaniel Nicandro
a224253a46 Rename jupyter--send-encoded -> jupyter-send, jupyter--recv-decoded -> jupyter-recv 2018-01-02 13:50:12 -06:00
Nathaniel Nicandro
940594fda6 Rename jupyter-request-* to jupyter-*-request
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`.
2018-01-02 13:50:08 -06:00
Nathaniel Nicandro
714b23c12f Guard against empty messages when flags are used 2017-12-27 00:17:03 -06:00
Nathaniel Nicandro
6721f91b08 Only attempt to decode time when a date field exists 2017-12-27 00:16:11 -06:00
Nathaniel Nicandro
785c8242d8 Fix time decoding 2017-12-27 00:13:43 -06:00
Nathaniel Nicandro
2616f5d49b Decode datetime into time objects, add more convenience functions 2017-12-22 00:38:03 -06:00
Nathaniel Nicandro
72ab6b1d9e JSON encoded plists convert nil to {} 2017-12-21 18:10:19 -06:00
Nathaniel Nicandro
0f44d88874 Add fractional seconds in timestamp 2017-12-21 18:09:45 -06:00
Nathaniel Nicandro
1e246ee480 [WIP] Move all socket communication to a subprocess
With this new implementation, all communication between the kernel and the
client happens in a subprocess. When the client would like to send a message,
the parent emacs process generates the required plist and sends it to the
subprocess for encoding and sending to the kernel. When a message is received,
the subprocess decodes it and prints it to the pipe for the parent emacs
process to read.

This implementation also introduces the use of futures to avoid having to wait
for subprocess output when sending a message to the kernel. Every
`jupyter-request-*` function now returns a primitive future object which is
just a cons cell with the `car` equal to `:jupyter-future`. When the `cdr` of
the future is non-nil, then it is the message ID of the sent request. This acts
as a check to ensure that the message ID is available from the future object,
if the `cdr` is nil the ID is not available, but if the `cdr` is non-nil then
it is the message ID. The convenience function `jupyter-ensure-id` ensures that
the message ID is available and returns the ID.

The future acts as a stand in for the message ID of the encoded request which
will be retrieved from the subprocess once the message has been encoded and
sent to the kernel. This future object is meant to be passed to
`jupyter-add-receive-callback` and other related functions the same way as an
actual message id.
2017-12-17 02:53:15 -06:00
Nathaniel Nicandro
ac8322cb97 More documentation on variables 2017-12-15 22:29:05 -06:00
Nathaniel Nicandro
ede2dacdd4 Convenience functions for handling messages 2017-12-15 22:28:45 -06:00
Nathaniel Nicandro
ad53e098f6 Move jupyter--received-message-types to jupyter-messages.el
Also fix naming issue, previously `recieved` when it should have been `received`.
2017-12-15 18:16:53 -06:00
Nathaniel Nicandro
d2654de9f6 Use the random state that is already present for generating UUID's
`cl-make-random-state` only creates a random state based on time with seconds
resolution.
2017-12-14 16:14:12 -06:00
Nathaniel Nicandro
725648e10d All messages sent use keys
Also use a variable `jupyter--false` instead of `:json-false` for possibly
supporting other encodings in the future.
2017-12-14 13:53:52 -06:00
Nathaniel Nicandro
bab7305cc8 Mark functions as private 2017-12-14 13:53:48 -06:00
Nathaniel Nicandro
76cf1c5eb7 Semi working prototype 2017-12-13 11:27:13 -06:00