You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(defunaio-call-process (program&restargs)
(let* ((process (apply#'start-file-process program "*aio-call-process*" program args))
(promise (aio-promise)))
(prog1
promise
(setf (process-sentinel process) (-partial #'aio-process-sentinel promise)))))
(defunaio-process-sentinel (promiseprocstatus)
"Sentinel that resolves the PROMISE using PROC and STATUS."
(aio-resolve
promise
(lambda ()
(with-current-buffer (process-buffer proc)
(prog1
(buffer-substring-no-properties (point-min) (point-max))
(kill-buffer))))))
(aio-defun aio-run (command &rest args)
(interactive)
(message"Start")
(message (aio-await (apply#'aio-call-process command args)))
(message"Stop"))
(aio-run "echo""123")
But if I just change (defun aio-call-process (program &rest args) to (aio-defun aio-call-process (program &rest args) then nothing works anymore. I'm confused, can you clarify why?
I thought aio-defun was to enable aio-await but that it was still somewhat of a normal function.
Also, apparently I'm supposed to use aio-make-callback to simplify the code above but honestly I have no clue how 😅
The text was updated successfully, but these errors were encountered:
Hello,
The following code works:
But if I just change
(defun aio-call-process (program &rest args)
to(aio-defun aio-call-process (program &rest args)
then nothing works anymore. I'm confused, can you clarify why?I thought
aio-defun
was to enableaio-await
but that it was still somewhat of a normal function.Also, apparently I'm supposed to use
aio-make-callback
to simplify the code above but honestly I have no clue how 😅The text was updated successfully, but these errors were encountered: