From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: jsonrpc.el closer to merging Date: Mon, 11 Jun 2018 09:08:12 -0400 Message-ID: <6733499b-b27f-0886-2e8d-bb59c59ace74@gmail.com> References: <87sh5uvdnr.fsf@gmail.com> <87k1r6uv3p.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1528722377 10398 195.159.176.226 (11 Jun 2018 13:06:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2018 13:06:17 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 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 Mon Jun 11 15:06:13 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 1fSMWR-0002b6-J8 for ged-emacs-devel@m.gmane.org; Mon, 11 Jun 2018 15:06:11 +0200 Original-Received: from localhost ([::1]:48746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSMYY-0005jd-NC for ged-emacs-devel@m.gmane.org; Mon, 11 Jun 2018 09:08:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSMYS-0005jX-El for emacs-devel@gnu.org; Mon, 11 Jun 2018 09:08:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSMYR-0003ad-Bl for emacs-devel@gnu.org; Mon, 11 Jun 2018 09:08:16 -0400 Original-Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:46464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSMYR-0003Zv-71 for emacs-devel@gnu.org; Mon, 11 Jun 2018 09:08:15 -0400 Original-Received: by mail-qk0-x231.google.com with SMTP id k86-v6so12818024qkh.13 for ; Mon, 11 Jun 2018 06:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zkIVQsEzah7DBizzKobgZwI9sqaiLu9XtmviHT+Catg=; b=TcQfAaPGo/F3ibl/7ydrewXhmtISoFfV7ABgnxRFmNsGoKBu7X4ZLRydpStezUE7EE 9AsypGsdL6/fJMZRhROENiCqOnlX3Hkg5KmhvpG48JCjaJBwNou/lSDrVoEPS/cJf5IE zVVQ2rS3V444wz7jPE4DRCdR8KucBVm2+hGQ4yBmndnpf58/BZaGXGy5uZ6kWs6jw307 JxouD5XRMXZ79suTNIwMGfBwkIWEYXs1TN6OOv8ya9rLHmDFHt5wBRG+zfb2YNaw6EIo ctpnt/GZt1thJWpm8hqM6V76Fk6kA+WG6QZWSj28lRTRwFbctP9fk1fx5iuNB8r+9Th0 6a9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zkIVQsEzah7DBizzKobgZwI9sqaiLu9XtmviHT+Catg=; b=thEpmR1DnEMIwHNLP2NgwzYT6uedm+eLD55fY46XaZ1sWN6GHsIAj/nEnADQ7RiUuI dVWsQLclO1TXJPDDt1Hk7zTYtuq+MgLcK541XOkqHDCXyh+EPZZvimGJDvWFrm3vBLZB h74TTvRiSBE2Tn/J7qsYLXWZ5guFAHMW6uFuRw534XHSBnchg/afkd+Q2NViTzLW2As2 dv1YnyTw9WWvx3Cneb7IKErjCfkXfw4cUORf/zzYafyF9VBfMuY+JO5380VmGSj7X3vX ZoPzwYtf5h9A6S88aDpyh6AOYMWvzij6TKaXRrZp6+/KLa+ZU6/hWG5dQTvYuHiichGW 5fBA== X-Gm-Message-State: APt69E0MwK1CeLsppN16tMByGOhvxjkasmcGEDWxM99cA03O+lDJzn6d lkXlPU3VHwpqpzghyniFFjoHVG8j X-Google-Smtp-Source: ADUXVKIGrPvPwnajWROaa2Fvr4kNbyGLOxPFkh2vCd+1GeS7s3ZpUnQ2KcH8YZrtBmaWzTXH2WoV8g== X-Received: by 2002:a37:cf97:: with SMTP id v23-v6mr14083687qkl.59.1528722494676; Mon, 11 Jun 2018 06:08:14 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:543d:e155:4a97:f2c9? ([2601:184:4180:66e7:543d:e155:4a97:f2c9]) by smtp.gmail.com with ESMTPSA id b3-v6sm13879317qtj.85.2018.06.11.06.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 06:08:14 -0700 (PDT) In-Reply-To: <87k1r6uv3p.fsf@gmail.com> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::231 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:226206 Archived-At: On 2018-06-10 18:36, João Távora wrote: > 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). Ah, neat. But then I'm confused. The spec you linked to (http://www.jsonrpc.org/specification) does distinguish, and there it seemed that only the client could send notifications. > 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. Thanks. The context is that I'm trying to see what I need to change to use your library. I have code in which the server responds with progress information as it processes a query. For example -> (id=xyz) Compute \pi to 15 decimals <- (id=xyz, progress) 10% done <- (id=xyz, progress) 60% done <- (id=xyz, response) 3.141592653589793 The same lambda gets invoked three times, twice with 'progress and a message, and once with 'done and a number. Is there a way to model this is json-rpc.el? Thanks! Clément.