Function: cider-nrepl-sync-request

cider-nrepl-sync-request is a byte-compiled function defined in cider-client.el.

Signature

(cider-nrepl-sync-request REQUEST &key CONNECTION ABORT-ON-INPUT CALLBACK)

Documentation

Send REQUEST to the nREPL server synchronously using CONNECTION.

Hold till final "done" message has arrived and join all response messages of the same "op" that came along and return the accumulated response. If ABORT-ON-INPUT is non-nil, the function will return nil at the first sign of user input, so as not to hang the interface. if CALLBACK is non-nil, it will additionally be called on all received messages.

This is the keyword-argument form; cider-nrepl-send-sync-request is the legacy positional shim retained for backward compatibility.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-client.el
(cl-defun cider-nrepl-sync-request (request &key connection abort-on-input callback)
  "Send REQUEST to the nREPL server synchronously using CONNECTION.
Hold till final \"done\" message has arrived and join all response messages
of the same \"op\" that came along and return the accumulated response.
If ABORT-ON-INPUT is non-nil, the function will return nil
at the first sign of user input, so as not to hang the
interface.
if CALLBACK is non-nil, it will additionally be called on all received messages.

This is the keyword-argument form; `cider-nrepl-send-sync-request' is the
legacy positional shim retained for backward compatibility."
  (let* ((conn (or connection (cider-current-repl 'infer 'ensure)))
         (response (nrepl-sync-request (cider--resolve-op-in-request request conn)
                                       conn
                                       :abort-on-input abort-on-input
                                       :callback callback)))
    ;; Handle cider-nrepl middleware's pp-stacktrace in sync responses.
    (when response
      (nrepl-dbind-response response (ex err pp-stacktrace status)
        (when (and ex err pp-stacktrace)
          (cider--render-stacktrace-causes pp-stacktrace
                                           (remove "done" status)))))
    response))