Dune handles invocation of the compiler and other tools and has to wait for results all while maximising parallelism. Has this process execution engine been extracted and used outside of Dune?
It has not been extracted. It’s quite a simple mechanism and all the secret sauce exists in two modules:
- Fiber - In particular Fiber.Throttle is what we use to enforce
- Scheduler - Handles waiting for processes and signalling this to
You should be able to adapt to your own application easily if you want to.
I also like the
process.ml - because I would like to execute external commands much like Dune.
That’s true. Just note that
process.ml mostly deals with stdin/stdout/stderr redirection and proper logging of commands executed by dune. You should just as easily be able to use the process creation functions in
Unix in your application.