[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Asynchronous Requests from Emacs Dynamic Modules"
From: |
Stefan Monnier |
Subject: |
Re: "Asynchronous Requests from Emacs Dynamic Modules" |
Date: |
Sat, 31 Oct 2020 08:49:21 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> With Emacs 28, you can get a file descriptor to a pipe process and
> send arbitrary data there (from arbitrary threads).
Cool, so that takes care of it.
> You'd still need some small protocol (e.g. JSON) to encode/decode
> requests, but with that you can send arbitrary requests
> back asynchronously.
I don't think you need a complex protocol: just stash somewhere (inside
the module data structures) the data you need for the async request,
then send a dummy byte to the pipe. On the Lisp side, just install
a process-filter which calls back the module to "run any pending async
requests".
Stefan
Re: "Asynchronous Requests from Emacs Dynamic Modules", Philipp Stephani, 2020/10/31
- Re: "Asynchronous Requests from Emacs Dynamic Modules",
Stefan Monnier <=