mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Add jupyter-requests-pending-p
This commit is contained in:
parent
83af335166
commit
1cc29e2ba0
1 changed files with 13 additions and 0 deletions
|
@ -731,6 +731,19 @@ reporting progress to the user while waiting."
|
||||||
(declare (indent 1))
|
(declare (indent 1))
|
||||||
(jupyter-wait-until req msg-type #'identity timeout progress-msg))
|
(jupyter-wait-until req msg-type #'identity timeout progress-msg))
|
||||||
|
|
||||||
|
(defun jupyter-requests-pending-p (client)
|
||||||
|
"Return non-nil if CLIENT has open requests that the kernel has not handled.
|
||||||
|
Specifically, this returns non-nil if the last request message
|
||||||
|
sent to the kernel using CLIENT has not received an idle message
|
||||||
|
back."
|
||||||
|
(cl-check-type client jupyter-kernel-client)
|
||||||
|
(jupyter--drop-idle-requests client)
|
||||||
|
(with-slots (requests) client
|
||||||
|
(let ((last-sent (gethash "last-sent" requests)))
|
||||||
|
(or (> (length requests) 1)
|
||||||
|
(when last-sent
|
||||||
|
(not (jupyter-request-idle-received-p last-sent)))))))
|
||||||
|
|
||||||
;;; Client handlers
|
;;; Client handlers
|
||||||
|
|
||||||
(cl-defgeneric jupyter-drop-request ((_client jupyter-kernel-client) _req)
|
(cl-defgeneric jupyter-drop-request ((_client jupyter-kernel-client) _req)
|
||||||
|
|
Loading…
Add table
Reference in a new issue