help-gnu-emacs
[Top][All Lists]
Advanced

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

about async process


From: akrl
Subject: about async process
Date: Sat, 25 Aug 2018 18:15:50 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix)

Hi all,
the question is: when is the process buffer updated after an async
process finish to execute?
This is what I'm trying to do:

(make-thread (lambda ()
               (let ((prc
                      (start-process-shell-command "test"
                                                   "out-buff"
                                                   "echo foo")))
                 (while (not (equal (process-status prc)
                                    'exit))
                   (thread-yield))
                 (with-current-buffer "out-buff"
                   (print (buffer-string))
                   (sleep-for 0.1)
                   (print (buffer-string))))))

I'm trying to execut an async process in a thread yielding till this has
finished and then reading the output.
When I execute this code the first print is printing "" and just the
second print after the sleep il latching the output I would expect.
So my question is when is the output buffer updated and if ther's a way to
ensure this has happend or to request for it?

Bests and thanks
  Andrea

-- 
akrl@sdf.org


reply via email to

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