Function: jsonrpc-async-request

jsonrpc-async-request is a byte-compiled function defined in jsonrpc.el.gz.

Signature

(jsonrpc-async-request CONNECTION METHOD PARAMS &rest ARGS &key SUCCESS-FN ERROR-FN TIMEOUT-FN TIMEOUT DEFERRED)

Documentation

Make a request to CONNECTION, expecting a reply, return immediately.

The JSONRPC request is formed by METHOD, a symbol, and PARAMS a JSON object.

The caller can expect SUCCESS-FN or ERROR-FN to be called with a JSONRPC :result or :error object, respectively. If this doesn't happen after TIMEOUT seconds (defaults to jrpc-default-request-timeout), the caller can expect TIMEOUT-FN to be called with no arguments. The default values of SUCCESS-FN, ERROR-FN and TIMEOUT-FN simply log the events into jsonrpc-events-buffer.

If DEFERRED is non-nil, maybe defer the request to a future time when the server is thought to be ready according to jsonrpc-connection-ready-p (which see). The request might never be sent at all, in case it is overridden in the meantime by a new request with identical DEFERRED and for the same buffer. However, in that situation, the original timeout is kept.

Returns nil.

Source Code

;; Defined in /usr/src/emacs/lisp/jsonrpc.el.gz
(cl-defun jsonrpc-async-request (connection
                                 method
                                 params
                                 &rest args
                                 &key _success-fn _error-fn
                                 _timeout-fn
                                 _timeout _deferred)
  "Make a request to CONNECTION, expecting a reply, return immediately.
The JSONRPC request is formed by METHOD, a symbol, and PARAMS a
JSON object.

The caller can expect SUCCESS-FN or ERROR-FN to be called with a
JSONRPC `:result' or `:error' object, respectively.  If this
doesn't happen after TIMEOUT seconds (defaults to
`jrpc-default-request-timeout'), the caller can expect TIMEOUT-FN
to be called with no arguments.  The default values of SUCCESS-FN,
ERROR-FN and TIMEOUT-FN simply log the events into
`jsonrpc-events-buffer'.

If DEFERRED is non-nil, maybe defer the request to a future time
when the server is thought to be ready according to
`jsonrpc-connection-ready-p' (which see).  The request might
never be sent at all, in case it is overridden in the meantime by
a new request with identical DEFERRED and for the same buffer.
However, in that situation, the original timeout is kept.

Returns nil."
  (apply #'jsonrpc--async-request-1 connection method params args)
  nil)