[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: synchronous network communication?
From: |
Helmut Eller |
Subject: |
Re: synchronous network communication? |
Date: |
Mon, 17 Jan 2011 08:21:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
* chris [2011-01-17 03:15] writes:
> and find the results in my buffer. However, this is an asynchronous
> communication and if the answer takes a while, my code might try to
> deal with the answer before it is ready. So my question is: is there
> a way to do this communication in an asynchronous manner?
If you mean synchronous manner, then the answer is no. A blocking API
would block the event loop and Emacs would appear to be "frozen".
You can however use a process-filter. That's a function that is called
with the data received from the other end. So you always know when data is
ready to process.
If you must use a synchronous mode (e.g. for the the completion code)
then you could use accept-process-output and/or recursive-edit but I
would avoid that as long as possible.
Helmut