From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: jsonrpc.el closer to merging Date: Sun, 10 Jun 2018 23:36:58 +0100 Message-ID: <87k1r6uv3p.fsf@gmail.com> References: <87sh5uvdnr.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 1528670144 12844 195.159.176.226 (10 Jun 2018 22:35:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2018 22:35:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 11 00:35:40 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 1fS8vz-0003FP-Uy for ged-emacs-devel@m.gmane.org; Mon, 11 Jun 2018 00:35:40 +0200 Original-Received: from localhost ([::1]:45386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS8y6-0006mv-Qz for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2018 18:37:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS8xQ-0006mn-DA for emacs-devel@gnu.org; Sun, 10 Jun 2018 18:37:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS8xL-0000Ow-Hf for emacs-devel@gnu.org; Sun, 10 Jun 2018 18:37:08 -0400 Original-Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:54235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fS8xL-0000OP-Ai for emacs-devel@gnu.org; Sun, 10 Jun 2018 18:37:03 -0400 Original-Received: by mail-wm0-x22e.google.com with SMTP id x6-v6so11485793wmc.3 for ; Sun, 10 Jun 2018 15:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=j0PJV2cTIvhM7Q0lwz0m5NbLBrkak+0NcB25hAhpLB4=; b=iepFnIVJMOC4EVuiov6cjLg9G74hw9OVwjGoVLM8qNg6gtqx+q3sTR3ORr63IkiUj3 dk89fBRf0NJ8T6SCjjMFO/QrjmbzUmJo0x6GECGI/InCU7korldcSypT45+oVN/cx/Ec EweI0zX02FTlr/Xi338xR9Q9Mve7G/Kx+avIq594LeUzEJ0zRQauUz0Bln7NAkzk6WEy 7n5/HzI7YinqQ+QN64C1KzvDQ0pPYDzrCHga+uazajEeWnuyFM3qAT8NApeEtv6XuFHb +znlNgBLAoz6DOrzRYQTPGawU0FakdzvZvqMamIk0uojuz0wc0M/Z76rMiO2JLecQhsi F3uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=j0PJV2cTIvhM7Q0lwz0m5NbLBrkak+0NcB25hAhpLB4=; b=EfYMhkn+gSaWtVUwEplwwKSK+35mqD13CTe1L4kyPP8pf5oLUBCnbujG1A5jSHQ6Bs SKaFhY+Q4kezNqyRM5vumJpPXX0j2AKdQy3V8GNXOfI/YEkKrRhHY4Xx5dn3gN4AqsNx 2ThyON3zA93mJbYp7YBj4vLkn3QdbQflUEXGQNu1awAecnBflH4N8rPbt5axD/iHNL3n A6f7Og7tu0XLfIfRbORMgFu8VKbGwrSp797LGG16lDP96AdHwNB9z1MVPCBvwZbjbml+ 1vfWeJoziP4DgYzpA6KCyRYEJmTWA0Ir75jDzLyWMBvsArh75U+AebGtYTK1ZWb7ouzb dF5A== X-Gm-Message-State: APt69E3H5WWOYRDR22A9cE1J/84cUTnKnMnyBB6RYFqiW/drkE+36Nrx h16q/2sJGOP8PUfRf3fEpCkPhZd0 X-Google-Smtp-Source: ADUXVKKoMKYEQJDLzMSGIHWa1ieploZWtHWlfv3j8JFGUHv4T5iemDqJGRkYptKTG5CyR+rqnXdxzg== X-Received: by 2002:a1c:f45:: with SMTP id 66-v6mr6568260wmp.124.1528670221932; Sun, 10 Jun 2018 15:37:01 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id z14-v6sm5329257wma.11.2018.06.10.15.37.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Jun 2018 15:37:01 -0700 (PDT) In-Reply-To: (=?utf-8?Q?=22Cl=C3=A9ment?= Pit-Claudel"'s message of "Sun, 10 Jun 2018 13:56:00 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22e 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:226171 Archived-At: Cl=C3=A9ment Pit-Claudel writes: > On 2018-06-10 11:56, Jo=C3=A3o T=C3=A1vora wrote: >> The last few weeks, I've been getting jsonrpc.el ready for integration >> into core (master/26.2) and/or ELPA.git. > It would be nice if you hosted this on ELPA, so that others could take > a dependency on that package without having to wait for new releases > of Emacs :) Yes ELPA is my plan too. As far as I understand, that isn't incompatible with also having it in core. > How closely does it follow JSON-RPC? Pretty closely, but JSONRPC is pretty lax :-) > For example, does it allow for servers to send notifications to > clients? Yes. Both endpoints can send requests that wait for responses, and notifications that don't. JSONRPC doesn't distinguish between clients and servers, though the application may do so (eglot.el does, for example). > Does it allow more than one response per query? Not sure I follow. In JSONRPC (and in most connection-oriented protocols) a response, by definition, something that a request waits on. Once it occurs the request is considered completed. jsonrpc.el has two ways to model this: jsonrpc-request, blocking and jsonrpc-async-request, a non-blocking. The remote endpoint can send more notifications after responding. Or the client can trigger more requests after it get its first response. > If the server is killed, what does it do with pending queries? Depends on the underlying transport. Currently the only concrete transport implementation, jsonrpc-process-connection, cancels all pending queries and calls their error handler. This means either a blocking jsonrpc-request will exit non-locally or you will get an error in the process sentinel. > Thanks again for this work! You're very welcome. Jo=C3=A3o