Commit graph

24 commits

Author SHA1 Message Date
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
5763aa3beb Cleanup/add more documentation for jupyter-channels 2018-01-22 18:48:20 -06:00
Nathaniel Nicandro
1d024d54cc Handle signal interrupts in the heartbeat channel 2018-01-16 11:52:59 -06:00
Nathaniel Nicandro
047968c4e9 Refactor jupyter-start-channel 2018-01-09 00:44:34 -06:00
Nathaniel Nicandro
a7539dc37b Fix checkdoc warnings 2018-01-09 00:44:34 -06:00
Nathaniel Nicandro
9ba6ad331e Remove uses of lexical-let 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
Nathaniel Nicandro
f904dc7d2a Rename jupyter-push-message -> jupyter-queue-message 2018-01-09 00:44:33 -06:00
Nathaniel Nicandro
71c4314a86 jupyter-connection inherits from eieio-instance-inheritor
This way when creating kernel clients with `jupyter-kernel-manager`, we can set
the `parent-instance` of the newly created client to the manager thereby
inheriting the `jupyter-session` from the kernel manager.

Also have `jupyter-channel` objects inherit from a `jupyter-connection` so that
we can define `jupyter-send` and `jupyter-recv` methods for channels in the future.
2018-01-07 14:53:12 -06:00
Nathaniel Nicandro
cfdf68eb43 Remove channel in some jupyter-channel method names 2018-01-06 19:55:46 -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
2c942fd0b7 Return the message without the identities in jupyter-channel-get-message 2018-01-06 19:55:44 -06:00
Nathaniel Nicandro
9dd45c6f3e Be consistent with how other channels are stopped
Specifically move the `jupyter-channel-alive-p` check into
`jupyter-stop-channel` for the heartbeat channel.
2018-01-06 19:54:40 -06:00
Nathaniel Nicandro
064bf4f031 Add functions to work with a jupyter-channel's recv-queue` 2018-01-02 13:50:13 -06:00
Nathaniel Nicandro
c7c200d571 Heartbeat channels are implemented with timers instead of a subprocess 2017-12-30 23:32:17 -06:00
Nathaniel Nicandro
46a449c496 Raise error when connecting channel with an unknown channel type 2017-12-22 00:54:18 -06:00
Nathaniel Nicandro
c6445530c7 HB channel process ignores signals 2017-12-22 00:53:18 -06:00
Nathaniel Nicandro
e9f04b20f8 Make the hb channel more efficient
Instead of constantly sending the subprocess input on every polling loop, poll
for input on stdin using the poller.
2017-12-19 11:47:45 -06:00
Nathaniel Nicandro
805255e816 New function jupyter-connect-channel
This function returns a socket based on a channel type and endpoint. The
channel type is mapped to the required socket type based on
`jupyter-channel-socket-types`. This is a convenience function to avoid having
to use `jupyter-channel-socket-types` directly.
2017-12-17 02:32:28 -06:00
Nathaniel Nicandro
3a3e742f8a Silence byte compiler 2017-12-14 13:58:46 -06:00
Nathaniel Nicandro
8e7436962b Fix function name 2017-12-14 13:58:18 -06:00
Nathaniel Nicandro
4e8cfb8bf6 Use lexical-let only where its needed 2017-12-14 13:58:18 -06:00
Nathaniel Nicandro
76cf1c5eb7 Semi working prototype 2017-12-13 11:27:13 -06:00