[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: jsonrpc.el closer to merging
From: |
João Távora |
Subject: |
Re: jsonrpc.el closer to merging |
Date: |
Sun, 10 Jun 2018 23:36:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Clément Pit-Claudel <address@hidden> writes:
> On 2018-06-10 11:56, João Távora 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ão
- jsonrpc.el closer to merging, João Távora, 2018/06/10
- Re: jsonrpc.el closer to merging, Clément Pit-Claudel, 2018/06/10
- Re: jsonrpc.el closer to merging,
João Távora <=
- Re: jsonrpc.el closer to merging, Clément Pit-Claudel, 2018/06/11
- Re: jsonrpc.el closer to merging, João Távora, 2018/06/11
- Re: jsonrpc.el closer to merging, João Távora, 2018/06/11
- Re: jsonrpc.el closer to merging, Clément Pit-Claudel, 2018/06/11
- Re: jsonrpc.el closer to merging, João Távora, 2018/06/13
Re: jsonrpc.el closer to merging, Stefan Monnier, 2018/06/10