Commit graph

9 commits

Author SHA1 Message Date
Nathaniel Nicandro
d1c6f74ead Remove jupyter-(send|recv) methods of a jupyter-session object
There is no need to have an extra function call and they were not used
anywhere else.

* jupyter-zmq-channel.el
(jupyter-send, jupyter-recv) [jupyter-session]: Remove. Update all
callers.
2021-04-03 12:22:58 -05:00
Nathaniel Nicandro
403c70c83c Bump version 2020-04-07 15:13:51 -05:00
conao3
fb8c2c75fd two spaces after a period 2020-03-12 18:20:15 -05:00
conao3
1546a72f57 clean header 2020-03-10 23:39:35 -05:00
Nathaniel Nicandro
091857a21b Remove unnecessary uses of jupyter-weak-ref 2019-08-27 14:02:53 -05:00
Nathaniel Nicandro
5b34e99bbf jupyter-hb-channel: Increase timeouts
See #141 and #164.

* jupyter-zmq-channel.el (jupyter-hb-max-failures): Reduce to 3.
(jupyter-hb-channel): Increase `time-to-dead` slot to 10 s.
2019-08-02 11:48:28 -05:00
Nathaniel Nicandro
6650dd3588 Bump version 2019-07-24 16:03:22 -05:00
Nathaniel Nicandro
8fc5f0bbee Make jupyter-channel-ioloop independent of zmq
This change localizes all `zmq` related functionality to `jupyter-ioloop` and
`jupyter-zmq-*` files.

* jupyter-channel-ioloop-comm.el: Add better commentary.
(jupyter-base): Require.
(jupyter-channel-ioloop-comm): Add `ioloop-class` slot
(initialize-instance [jupyter-channel-ioloop-comm]): Use it.

* jupyter-channel-ioloop.el (jupyter-base, jupyter-zmq-channel): Un-require.
(jupyter-ioloop-session, jupyter-ioloop-channels):
Rename to `jupyter-channel-ioloop-session` `jupyter-channel-ioloop-channels` and
update all callers.
(jupyter-channel-ioloop): Make into an abstract class.
(initialize-instance [jupyter-channel-ioloop]): Re-add
`jupyter-channel-ioloop-add-send-event`. Don't add to
`jupyter-ioloop-post-hook`.
(jupyter-channel-ioloop-recv-messages): Remove.
(jupyter-channel-ioloop--set-session, jupyter-ioloop-start)
(jupyter-channel-ioloop-add-send-event): Doc changes.
(jupyter-channel-ioloop-add-start-channel-event)
(jupyter-channel-ioloop-add-stop-channel-event):
Don't add/remove from the `jupyter-ioloop-poller`.
Now expected to be handled in the `jupyter-channel` subclass.
Update documentation. In addition, for the start-channel event,
do not attempt to add a channel if one doesn't already exist.

* jupyter-ioloop.el
(jupyter-ioloop-add-teardown):
Remove mention of `jupyter-channel-ioloop` behavior.
(jupyter-ioloop-add-arg-type): Update example variable.
(jupyter-ioloop-environment-p): New function.

* jupyter-kernel-manager.el (jupyter-channel): Require.
(jupyter-make-client): Require and use `jupyter-zmq-channel-ioloop`.
(jupyter-start-channels): Use `make-instance`.
(jupyter-interrupt-kernel): Remove `condition-case`. Not needed since
preventing socket blocking is now handled by `jupyter-recv`.

* jupyter-repl.el
(jupyter-connect-repl): Require and use `jupyter-zmq-channel-ioloop`.

* jupyter-zmq-channel-ioloop.el: New file.

* jupyter-zmq-channel.el (jupyter-ioloop-poller-remove)
(jupyter-ioloop-poller-add): New declares.
(jupyter-start-channel):
Add to `jupyter-ioloop-poller` when in `jupyter-ioloop-environment-p`.
(jupyter-stop-channel):
Only disconnect the socket from its endpoint instead of closing it, leave that
up to garbage collection.
Remove from `jupyter-ioloop-poller` when in `jupyter-ioloop-environment-p`.
(jupyter-recv): Handle non-blocking.

* test/jupyter-test.el
(jupyter-zmq-channel): Use non-blocking `zmq-send` since socket is no longer
closed when calling `jupyter-stop-channel`.
(jupyter-ioloop-test-eval-ioloop): Rename to `jupyter-test-ioloop-eval-event`,
update all callers, and move to `test/test-helper.el`.
(jupyter-channel-ioloop-send-event, jupyter-channel-ioloop-stop-channel-event)
(jupyter-channel-ioloop-start-channel-event): Fix tests for variable name
changes. Use `jupyter-test-channel-ioloop`. Update `jupyter-ioloop-poller`,
addition/removal from poller is now done in the `jupyter-channel` subclass by
checking `jupyter-ioloop-environment-p`.

* test/test-helper.el (jupyter-zmq-channel-ioloop): Require.
(initialize-instance [jupyter-echo-client]): Use it.
(jupyter-test-channel-ioloop): New macro.
(jupyter-test-ioloop-eval-event): New function.
2019-06-30 12:22:26 -05:00
Nathaniel Nicandro
58b715a4e8 Break up jupyter-channels.el to further decouple zmq
* jupyter-channel-ioloop.el (jupyter-zmq-channel): Require.
(jupyter-channel-ioloop-add-start-channel-event): `sync` -> `zmq`

* jupyter-comm-layer (jupyter-comm--channel): Moved from `jupyter-channels.el`.

* jupyter-kernel-manager.el: `sync` -> `zmq`

* jupyter-zmq-channel-comm.el: New file.

* jupyter-channels.el: Mostly renamed to jupyter-zmq-channel.el. The
`jupyter-channel` class was moved to `jupyter-channel.el`. All that remains are
those classes dependent on `zmq`.

* test/jupyter-test.el: `sync` -> `zmq` where appropriate.

Extract `jupyter-channel` class from `jupyter-zmq-channel.el` into its own file
2019-06-29 14:11:04 -05:00
Renamed from jupyter-channels.el (Browse further)