]> code.delx.au - gnu-emacs-elpa/blob - README.md
45c4b46c403d217b5c266e97a38fd7331da48560
[gnu-emacs-elpa] / README.md
1 # emacs-async
2
3 Adds the ability to process Lisp concurrently, with a very simple syntax:
4
5 (async-start
6 ;; What to do in the child process
7 (lambda ()
8 (message "This is a test")
9 (sleep-for 3)
10 222)
11
12 ;; What to do when it finishes
13 (lambda (result)
14 (message "Async process done, result should be 222: %s" result)))
15
16 If you omit the callback function, `async-start` will return a process object
17 that you can `async-get` on when you're ready to wait for the result value:
18
19 (let ((proc (async-start
20 ;; What to do in the child process
21 (lambda ()
22 (message "This is a test")
23 (sleep-for 3)
24 222))))
25 (message "I'm going to do some work here")
26 ;; ....
27 (message "Async process done, result should be 222: %s"
28 (async-get proc)))