[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 07359a2 15/69: Allow null timeouts and set defaul
From: |
João Távora |
Subject: |
[elpa] externals/eglot 07359a2 15/69: Allow null timeouts and set default to 3 seconds |
Date: |
Fri, 22 Jun 2018 11:54:55 -0400 (EDT) |
branch: externals/eglot
commit 07359a2635ca2cd04e693bb8598e65a85e1d960c
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Allow null timeouts and set default to 3 seconds
* jrpc.el (jrpc-request-timeout): Allow nil.
(jrpc--process-sentinel): Handle no timeout.
(jrpc--async-request): Maybe make no timer.
---
jrpc.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/jrpc.el b/jrpc.el
index eff941a..7303414 100644
--- a/jrpc.el
+++ b/jrpc.el
@@ -125,8 +125,9 @@
:prefix "jrpc-"
:group 'applications)
-(defcustom jrpc-request-timeout 10
- "How many seconds to wait for a reply from the server."
+(defcustom jrpc-request-timeout 3
+ "How many seconds to wait for a JSONRPC from the server.
+If nil, don't use a timeout (not recommended)."
:type :integer)
(defvar jrpc-find-process-functions nil
@@ -297,7 +298,7 @@ type.
;; Cancel outstanding timers
(maphash (lambda (_id triplet)
(pcase-let ((`(,_success ,_error ,timeout) triplet))
- (cancel-timer timeout)))
+ (when timeout (cancel-timer timeout))))
(jrpc--request-continuations proc))
(unwind-protect
;; Call all outstanding error handlers
@@ -529,15 +530,16 @@ Return the request ID, or nil, in case the request was
deferred."
(make-timeout
(lambda ( )
(or existing-timer
- (run-with-timer
- timeout nil
- (lambda ()
- (remhash id (jrpc--request-continuations proc))
- (funcall (or timeout-fn
- (lambda ()
- (jrpc-log-event
- proc `(:timed-out ,method :id id
- :params ,params)))))))))))
+ (when timeout
+ (run-with-timer
+ timeout nil
+ (lambda ()
+ (remhash id (jrpc--request-continuations proc))
+ (funcall (or timeout-fn
+ (lambda ()
+ (jrpc-log-event
+ proc `(:timed-out ,method :id id
+ :params
,params))))))))))))
(when deferred
(let* ((buf (current-buffer))
(existing (gethash (list deferred buf) (jrpc--deferred-actions
proc))))
- [elpa] externals/eglot updated (0176264 -> f385d9c), João Távora, 2018/06/22
- [elpa] externals/eglot f4de5d7 01/69: Fix copyright header. Obviously not since 2003, João Távora, 2018/06/22
- [elpa] externals/eglot 5cda0ec 06/69: Fix a ridiculous bug when generating transient projects, João Távora, 2018/06/22
- [elpa] externals/eglot e5120aa 08/69: Add jrpc.el to Makefile, João Távora, 2018/06/22
- [elpa] externals/eglot 07359a2 15/69: Allow null timeouts and set default to 3 seconds,
João Távora <=
- [elpa] externals/eglot 67d8335 17/69: jrpc.el should know nothing of mode-line updates, João Távora, 2018/06/22
- [elpa] externals/eglot 0e1a5f0 05/69: jrpc-connect is now passed a generic dispatching function, João Távora, 2018/06/22
- [elpa] externals/eglot 078a1a6 13/69: Add full "Commentary" section to jrpc.el, João Távora, 2018/06/22
- [elpa] externals/eglot 2f1d76d 03/69: Proper server shutdown when jrpc.el is used, João Távora, 2018/06/22
- [elpa] externals/eglot a2aa1ed 19/69: Robustify timer handling for jrpc-async-request, João Távora, 2018/06/22
- [elpa] externals/eglot 7769c07 16/69: Send message, then establish continuations, João Távora, 2018/06/22
- [elpa] externals/eglot 7f2e894 11/69: Merge branch 'master' into jsonrpc-refactor (using good ol' git merge), João Távora, 2018/06/22
- [elpa] externals/eglot e5ba4f6 18/69: Automatically reply with error if dispatcher doesn't, João Távora, 2018/06/22
- [elpa] externals/eglot 33ae871 09/69: More flexible jrpc.el and improve eglot.el's doc, João Távora, 2018/06/22
- [elpa] externals/eglot 3265c1d 10/69: Simpler callback protocol for JSONRPC parameters and results, João Távora, 2018/06/22