mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Add more documentation
This commit is contained in:
parent
f13f18b12b
commit
276c02cfce
1 changed files with 27 additions and 2 deletions
|
@ -39,7 +39,7 @@
|
||||||
:type keyword
|
:type keyword
|
||||||
:initarg :type
|
:initarg :type
|
||||||
:documentation "The type of this channel. Should be one of
|
:documentation "The type of this channel. Should be one of
|
||||||
the keys in `jupyter-channel-socket-types'.")
|
the keys in `jupyter-channel-socket-types'.")
|
||||||
(session
|
(session
|
||||||
:type jupyter-session
|
:type jupyter-session
|
||||||
:initarg :session
|
:initarg :session
|
||||||
|
@ -63,7 +63,16 @@ send/receive messages.")
|
||||||
:type (or null process)
|
:type (or null process)
|
||||||
:initform nil
|
:initform nil
|
||||||
:documentation "The process responsible for sending and
|
:documentation "The process responsible for sending and
|
||||||
receiving messages on this channel.")
|
receiving messages on this channel.
|
||||||
|
|
||||||
|
This subprocess is responsible for receiving message
|
||||||
|
s-expressions sent by the `jupyter-send' method for a
|
||||||
|
`jupyter-async-channel', encoding the message, and sending the
|
||||||
|
encoded message to the kernel.
|
||||||
|
|
||||||
|
The parent Emacs process is then responsible for calling
|
||||||
|
`jupyter-queue-message' when a message is received from the
|
||||||
|
subprocess.")
|
||||||
(recv-queue
|
(recv-queue
|
||||||
:type ring
|
:type ring
|
||||||
:initform (make-ring 10))
|
:initform (make-ring 10))
|
||||||
|
@ -137,6 +146,22 @@ wait until TIMEOUT for a message."
|
||||||
msg))))
|
msg))))
|
||||||
|
|
||||||
(cl-defmethod jupyter-send ((channel jupyter-async-channel) type message &optional msg-id)
|
(cl-defmethod jupyter-send ((channel jupyter-async-channel) type message &optional msg-id)
|
||||||
|
"Send an asynchronous MESSAGE on CHANNEL.
|
||||||
|
MESSAGE is sent to the subprocess in CHANNEL's ioloop slot which
|
||||||
|
is expected to send the message to the kernel. The list sent to
|
||||||
|
the subprocess has the following form
|
||||||
|
|
||||||
|
(send CHANNEL-TYPE TYPE MESSAGE MSG-ID)
|
||||||
|
|
||||||
|
where CHANNEL-TYPE is either `:iopub', `:shell', `:hb',
|
||||||
|
`:control', TYPE is the message type (one of the keys in
|
||||||
|
`jupyter-message-types'), MESSAGE is the message plist to send,
|
||||||
|
and MSG-ID is the unique message ID to associate with the message
|
||||||
|
with nil meaning to generate a new ID.
|
||||||
|
|
||||||
|
When a message is received from the kernel, the subprocess is
|
||||||
|
responsible for placing the message in CHANNEL's message queue
|
||||||
|
using `jupyter-queue-message'."
|
||||||
(zmq-subprocess-send (oref channel ioloop)
|
(zmq-subprocess-send (oref channel ioloop)
|
||||||
(list 'send (oref channel type) type message msg-id)))
|
(list 'send (oref channel type) type message msg-id)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue