From: Filipp Gunbin <fgunbin@fastmail.fm>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: comments about jsonrpc.el
Date: Wed, 06 Jun 2018 23:43:46 +0300 [thread overview]
Message-ID: <m2in6v63y5.fsf@fgunbin.playteam.ru> (raw)
In-Reply-To: <87r2lqt3vz.fsf@gmail.com> ("João Távora"'s message of "Sat, 02 Jun 2018 01:42:56 +0100")
João,
On 02/06/2018 01:42 +0100, João Távora wrote:
>> 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?).
>
> You mean *all* deferred actions? I believe the right thing to do is to
> clear the one that is about to run, since the other ones may be
> subject to other conditions.
If they are independent of each other - then yes, probably only the one
which runs.
>> 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.
>
> No, it is (a) that is done, because we store the timer as the second
> element in (FN TIMER ID) pointed to by the deferred action. And we don't
> re-create the timer.
But line 643 says '(setq timer (funcall make-timer)))' - isn't it what
gets into continuation? To be clear - I mean the timer which gets into
continuation (but if we re-defer deferred action - then yes, the
deferred action's timer is "inherited").
>> 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)
>
> A call to jsonrpc--async-request-1 that defers itself is always ends up
> being called again with the very same arguments. It is the
> jsonrpc-connection-ready-p predicate that decides it the action runs.
I'm just not familiar with cl-defun enough, sorry. If '&rest args'
includes 'deferred' in 'args', then ok.
Thanks!
Filipp
next prev parent reply other threads:[~2018-06-06 20:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 20:00 comments about jsonrpc.el Filipp Gunbin
2018-06-02 0:42 ` João Távora
2018-06-06 20:43 ` Filipp Gunbin [this message]
2018-06-10 11:39 ` João Távora
2018-06-13 19:09 ` Filipp Gunbin
2018-06-13 19:21 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2in6v63y5.fsf@fgunbin.playteam.ru \
--to=fgunbin@fastmail.fm \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).