From 954c865e74757152d8fd00e0394edcd8f748be0e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 18 Jun 2012 19:30:47 -0500 Subject: [PATCH] Updated README --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ec7e83ac9..f7bc852d9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # emacs-async -Adds the ability to process Lisp concurrently, with a very simple syntax: +async.el is an exceedingly simple (78 lines of code) module for doing +asynchronous processing in Emacs, by spawning a child Emacs interpreter to +execute a lambda function, and calling back when the job is done. + +It uses a very simple syntax: (async-start ;; What to do in the child process @@ -13,9 +17,8 @@ Adds the ability to process Lisp concurrently, with a very simple syntax: (lambda (result) (message "Async process done, result should be 222: %s" result))) -If you omit the callback function, `async-start` will return a process object -that you can call `async-get` on when you're ready to wait for the result -value: +If you omit the callback function, `async-start` returns a process object that +you can call `async-get` on when you're ready to wait for the result value: (let ((proc (async-start ;; What to do in the child process @@ -23,13 +26,16 @@ value: (message "This is a test") (sleep-for 3) 222)))) - (message "I'm going to do some work here") - ;; .... - (message "Async process done, result should be 222: %s" + + (message "I'm going to do some work here") ;; .... + + (message "Waiting on async process, result should be 222: %s" (async-get proc))) If you don't want to use a callback, and you don't care about any return value -form the child proces, pass the `ignore` symbol as the second argument: +form the child process, pass the `ignore` symbol as the second argument (if +you don't, and never call `async-get', it will leave *emacs* process buffers +hanging around): (async-start (lambda () -- 2.39.2