Function: jsonrpc-connection
jsonrpc-connection is a byte-compiled function defined in
jsonrpc.el.gz.
Signature
(jsonrpc-connection &rest SLOTS)
Documentation
Create a new object of class type jsonrpc-connection(var)/jsonrpc-connection(fun).
Source Code
;; Defined in /usr/src/emacs/lisp/jsonrpc.el.gz
;;; Public API
;;;
(defclass jsonrpc-connection ()
((name
:accessor jsonrpc-name
:initform "anonymous"
:initarg :name
:documentation "A name for the connection")
(-request-dispatcher
:accessor jsonrpc--request-dispatcher
:initform #'ignore
:initarg :request-dispatcher
:documentation "Dispatcher for remotely invoked requests.")
(-notification-dispatcher
:accessor jsonrpc--notification-dispatcher
:initform #'ignore
:initarg :notification-dispatcher
:documentation "Dispatcher for remotely invoked notifications.")
(last-error
:initform nil
:accessor jsonrpc-last-error
:documentation "Last JSONRPC error message received from endpoint.")
(-continuations
:initform nil
:accessor jsonrpc--continuations
:documentation "An alist of request IDs to continuation specs.")
(-events-buffer
:initform nil
:accessor jsonrpc--events-buffer
:documentation "A buffer pretty-printing the JSONRPC events")
(-events-buffer-config
:initform '(:size nil :format full)
:initarg :events-buffer-config
:documentation "Plist configuring the events buffer functions.")
(-deferred-actions
:initform (make-hash-table :test #'equal)
:accessor jsonrpc--deferred-actions
:documentation "Map (DEFERRED BUF) to (FN TIMER ID). FN is\
a saved DEFERRED `async-request' from BUF, to be sent not later\
than TIMER as ID.")
(-sync-request-alist ; bug#67945
:initform nil
:accessor jsonrpc--sync-request-alist
:documentation "List of ((ID [ANXIOUS...])) where ID refers \
to a sync `jsonrpc-request' and each ANXIOUS to another completed\
request that is higher up in the stack but couldn't run.")
(-next-request-id
:initform 0
:accessor jsonrpc--next-request-id
:documentation "Next number used for a request"))
:documentation "Base class representing a JSONRPC connection.
The following keyword argument initargs are accepted:
:NAME (mandatory), a string naming the connection
:REQUEST-DISPATCHER (optional), a function of three
arguments (CONN METHOD PARAMS) for handling JSONRPC requests.
CONN is a `jsonrpc-connection' object, method is a symbol, and
PARAMS is a plist representing a JSON object. The function is
expected to return a JSONRPC result, a plist of (:result
RESULT) or signal an error of type `jsonrpc-error'.
:NOTIFICATION-DISPATCHER (optional), a function of three
arguments (CONN METHOD PARAMS) for handling JSONRPC
notifications. CONN, METHOD and PARAMS are the same as in
:REQUEST-DISPATCHER.
:EVENTS-BUFFER-CONFIG is a plist. Its `:size' stipulates the
size of the log buffer (0 disables, nil means infinite). The
`:format' property is a symbol for choosing the log entry format.")