unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: jsonrpc.el closer to merging
Date: Mon, 11 Jun 2018 09:08:12 -0400	[thread overview]
Message-ID: <6733499b-b27f-0886-2e8d-bb59c59ace74@gmail.com> (raw)
In-Reply-To: <87k1r6uv3p.fsf@gmail.com>

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.



  reply	other threads:[~2018-06-11 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-10 15:56 jsonrpc.el closer to merging João Távora
2018-06-10 17:56 ` Clément Pit-Claudel
2018-06-10 22:36   ` João Távora
2018-06-11 13:08     ` Clément Pit-Claudel [this message]
2018-06-11 14:42       ` João Távora
2018-06-11 22:26         ` João Távora
2018-06-11 23:13           ` Clément Pit-Claudel
2018-06-13 10:19             ` João Távora
2018-06-11  1:46 ` Stefan Monnier
2018-06-11  6:34   ` João Távora
2018-06-11 12:30     ` Stefan Monnier

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=6733499b-b27f-0886-2e8d-bb59c59ace74@gmail.com \
    --to=cpitclaudel@gmail.com \
    --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).