[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/async a982ab7a9a 3/4: docs: add note about how to use r
From: |
ELPA Syncer |
Subject: |
[elpa] externals/async a982ab7a9a 3/4: docs: add note about how to use result of child async-send |
Date: |
Thu, 9 Mar 2023 07:57:24 -0500 (EST) |
branch: externals/async
commit a982ab7a9a72c99b3867a6fb5a123f724ddcadcb
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Matus Goljer <matus.goljer@gmail.com>
docs: add note about how to use result of child async-send
---
async.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/async.el b/async.el
index 28b9a87c2b..3761354f73 100644
--- a/async.el
+++ b/async.el
@@ -400,6 +400,16 @@ When done, the return value is passed to FINISH-FUNC.
Example:
(message \"Async process done, result should be 222: %s\"
result)))
+If you call `async-send' from a child process, the message will
+be also passed to the FINISH-FUNC. You can test RESULT to see if
+it is a message by using `async-message-p'. If nil, it means
+this is the final result. Example of the FINISH-FUNC:
+
+ (lambda (result)
+ (if (async-message-p result)
+ (message \"Received a message from child process: %s\" result)
+ (message \"Async process done, result: %s\" result)))
+
If FINISH-FUNC is nil or missing, a future is returned that can
be inspected using `async-get', blocking until the value is
ready. Example: