Giter VIP home page Giter VIP logo

Comments (3)

astahlman avatar astahlman commented on August 24, 2024

Off the top of my head, we might be able to add a new function like ob-async-execute-subtree which adds a function to org-babel-after-execute-hook and kicks off the first src-block. The hook function would then jump to the next src-block and execute it.

Open to ideas or pull requests, here.

from ob-async.

hraban avatar hraban commented on August 24, 2024

Without async mode, you could achieve something like this by defining blocks as inputs of other blocks, e.g.:

* Test

#+begin_src emacs-lisp :results none
(setq-local org-confirm-babel-evaluate nil)
#+end_src

#+name: test1
#+begin_src sh :results verbatim :cache yes
sleep 3
echo test 1
date -u
#+end_src

#+begin_src sh :results verbatim :var ignore=test1 :cache yes
date -u
echo test 2
#+end_src

The second block will wait for the first block to complete, perhaps implicitly because evaluation is blocking (I don't know) but the effect is the same: this works.

With ob-async, it seems like a block is immediately considered "done" from babel's pov, so the next block will start immediately, with the first (place-holder) result as input. An error is thrown and the second block never completes:

error in process sentinel: if: Invalid read syntax: "#<"
error in process sentinel: Invalid read syntax: "#<"

If ob-async could somehow detect that an input block is, itself, a pending ob-async operation, and block evaluation until that dependent block is done, you could fix both the expected behaviour, and this github issue could be solved by using the same technique.

What do you think?

from ob-async.

hraban avatar hraban commented on August 24, 2024

Related to #60

from ob-async.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.