[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jsonrpc.el closer to merging

From: Clément Pit-Claudel
Subject: Re: jsonrpc.el closer to merging
Date: Mon, 11 Jun 2018 09:08:12 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

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 
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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]