From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: Re: comments about jsonrpc.el Date: Wed, 06 Jun 2018 23:43:46 +0300 Message-ID: References: <87r2lqt3vz.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528317721 12487 195.159.176.226 (6 Jun 2018 20:42:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2018 20:42:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 06 22:41:57 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQfFi-000360-BQ for ged-emacs-devel@m.gmane.org; Wed, 06 Jun 2018 22:41:55 +0200 Original-Received: from localhost ([::1]:54606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQfHo-0000q5-1S for ged-emacs-devel@m.gmane.org; Wed, 06 Jun 2018 16:44:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQfHg-0000px-GJ for emacs-devel@gnu.org; Wed, 06 Jun 2018 16:43:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQfHd-0003Eh-Dt for emacs-devel@gnu.org; Wed, 06 Jun 2018 16:43:56 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36369) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQfHd-0003DP-7u for emacs-devel@gnu.org; Wed, 06 Jun 2018 16:43:53 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C059D21B88; Wed, 6 Jun 2018 16:43:49 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 06 Jun 2018 16:43:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=YL1Knlmtdu3j811GlX7YzMZUcfWS9 sU+0sncg0C2UXM=; b=WKx9xBMYB/KihpRxFUi3bBgTRAaW79jnpSvOUi6IO+VCs wn59rWVLdBt1sN+/Svh+fOQ0QZjgbAo9sjHEjcWg1zegCFDYPtxrH8OPOa7eVXB7 deRwHdYbZQD9wsXkFKYcgzdmJmFsUdAONNAjG5ic/2Bgg9QNjnqc5OBIdXhOGDb2 yaUMMqKcsb2uP1dGTZKcAfdXuNQ7PVYDlIiBpkW59MgTA61EDw05v9AnTe1L6j6o VTHLWh1cgYakMnrptaLY9/xZDX/4PB9MPRtZ+mCSEOTC96hq9spI5HP9V//maMPH 9kb8wUMVrcRETUd1frC4CHH0kn/ZIH6iExSz9k1Ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=YL1Knl mtdu3j811GlX7YzMZUcfWS9sU+0sncg0C2UXM=; b=US8kvJ+a2qcWZBeL2LcUi/ T7mFegfThi4U0sLsxuEhe4gaSXuAj0uZGoTDz4I3D6wErzdAMPMfy1OLwgpYR05p jWsXI9NsAA6pX+b22Nl6uNgQ1SlDMzNrWJWwEQSo/yzoVeLudf7zsAz9w8oRYoR6 S3L3v+0F0TaWBxMh0gbA+vmv2JKwBie1JIveI4UO+vKhSLfQL6vMywsCCdS5k55z 2QXdEJHsUHmzU3nkcrB6AijUZ6qVvGN51O+7uipXtV3kO09zIx59MBfjn+E5kBPN 5WOCqy47kBia+xvbZynlCa53kvIdPsBabPYGFpygao6Wj7vaxbOboxk0vtvui6yQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Original-Received: from fgunbin.playteam.ru (unknown [94.25.218.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 02307E43E8; Wed, 6 Jun 2018 16:43:48 -0400 (EDT) In-Reply-To: <87r2lqt3vz.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Sat, 02 Jun 2018 01:42:56 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226078 Archived-At: Jo=C3=A3o, On 02/06/2018 01:42 +0100, Jo=C3=A3o T=C3=A1vora 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=3Dt 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