Asynchronous src_block execution for org-babel
ob-asyncenables asynchronous execution of org-babel src blocks, like this:
ob-asyncisn't tied to src blocks in a specific org-babel language. Simply add the keyword
:asyncto the header-args of any org-babel src block and invoke
ob-async-org-babel-execute-src-block.
ob-asyncis available in MELPA. If you'd rather install from source, make sure
ob-async.elis on your
load-path, like this.
(add-to-list 'load-path "$PATH_TO_OB_ASYNC_ROOT_DIR")
Require the package and
ob-asyncwill handle any source block which includes
:asyncin its header-args.
(require 'ob-async)
ob-asyncshould work with no additional setup for most languages. However, there are a few known edge-cases which require extra configuration.
Some org-babel languages (e.g.,
ob-python) define their own
:asynckeyword that conflicts with
ob-async.
ob-asyncwill ignore any languages in this blacklist, even if the
:asynckeywords is present. Note that the
-alistsuffix is misleading; this variable actually represents a plain list and will be renamed in a future release.
Example:
(setq ob-async-no-async-languages-alist '("ipython"))
For additional context, see https://github.com/astahlman/ob-async/pull/35.
Some org-babel languages require additional user configuration. For example,
ob-juliarequires
inferior-julia-program-nameto be defined. Normally you would define such variables in your
init.el, but src block execution occurs in an Emacs subprocess which does not evaluate
init.elon startup. Instead, you can place initialization logic in
ob-async-pre-execute-src-block-hook, which runs before execution of every src block.
Example:
(add-hook 'ob-async-pre-execute-src-block-hook '(lambda () (setq inferior-julia-program-name "/usr/local/bin/julia")))
For additional context, see https://github.com/astahlman/ob-async/issues/37 and https://github.com/jwiegley/emacs-async/pull/73.
Cask manages dependencies and runs tests. Once Cask is installed, you can
make test.
First, go through the troubleshooting checklist,
troubleshooting.org. It's an org-mode file in this repository that's designed to diagnose issues with ob-async. If that doesn't solve your problem, include a copy of the entire file (which will include your
#+RESULTSblocks) in a Github issue.