>From cbe52d3e91d02041513fe3ff149b766b48ad09d8 Mon Sep 17 00:00:00 2001 From: Frederick Giasson Date: Wed, 6 Apr 2016 12:13:21 -0400 Subject: [PATCH 2/2] Documentation for the new org-babel-clojure :async feature. --- org-contrib/babel/languages/ob-doc-clojure.org | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/org-contrib/babel/languages/ob-doc-clojure.org b/org-contrib/babel/languages/ob-doc-clojure.org index 17c0f20..d309975 100644 --- a/org-contrib/babel/languages/ob-doc-clojure.org +++ b/org-contrib/babel/languages/ob-doc-clojure.org @@ -145,6 +145,31 @@ Another source for information on options is this page at Worg: Next, a similar process for executing code will be used with Clojure. +* Using Asynchronous Evaluations +Org-babel-clojure does support asynchronous evaluation of the code blocks. To +evaluate some code asynchronously, you only have to specify the =:async= option +in the code block's header like this: + +#+begin_example +#+BEGIN_SRC clojure :results output :async + (dotimes [n 10] + (println n ".") + (Thread/sleep 500)) +#+END_SRC +#+end_example + +If =:async= is specified that way, then when you will run the code using +=C-c C-c= then a new window will open in Emacs. Everything that is output +by the REPL will immediately be added to that new window. + +When the processing of the code is finished, then the window and its +buffer will be closed and the results will be reported in the +=#+RESULTS= section. Note that the =:results= parameter like normally. If +=silent= is specified, then no result will be displayed. If =output= is +specified then all the output from the window will appears in the results +section. If =value= is specified, then only the last returned value of +the code will be displayed in the results section. + * Connect to the REPL To compile and run Clojure code, you will need to connect to a REPL (Read Evaluation Print Loop). -- 1.9.5.msysgit.0