[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
comments about jsonrpc.el
From: |
Filipp Gunbin |
Subject: |
comments about jsonrpc.el |
Date: |
Fri, 01 Jun 2018 23:00:39 +0300 |
I was reading the last jsonrpc.el from jsonrpc-refactor branch in eglot
repo and got few comments. Sorry if I'm misreading something.
1) When deferred action times out, the timer clears continuations and
calls timeout-fn. I think it should also clear deferred actions, so
they are not called from next jsonrpc--connection-receive afterwards.
2) When deferred action runs, it invokes jsonrpc-async-request which
invokes jsonrpc-connection-send. I think we should also clear
deferred actions here (why leave them?). Also, there seem to be two
ways to handle timer: a) take timer from deferred action and save it
in continuation - then its timeout spans both 'wait until server
ready' interval and actual response wait interval; b) cancel deferred
action timer and create new timer - it's done in the current code.
3) When deferred action runs, jsonrpc--async-request-1 should be
called with 'deferred' non-nil - so it actually sends request. But
it's unclear to me how this deferred=t is passed there ('apply' call
on line 621)
4) jsonrpc--async-request-1 - non-local exit is missing (I saw it in
the version you posted here)
5) jsonrpc-request: there's unwind-protect with some cleanup. Seems
that we also need to clean deferred actions and cancel timer (that is
in continuation). Another option - maybe we can just bind
inhibit-quit to t instead of this unwind-protect with cleanup?
Filipp
- comments about jsonrpc.el,
Filipp Gunbin <=