dundalek/closh

Run command in the background with &

dundalek opened this issue · 2 comments

This might involve needing to implement job control to keep track of running background processes.

@dundalek Did you have any ideas on how job control should be implemented?

@djblue My thought process is that I don't think I've ever needed the full job control using jobs, fg and bg during all my years with bash. Therefore I would like to try if it is possible to make something simpler.

I imagine we could wrap background processes in a future (to make them run in a separate thread so they don't block in case there is a clojure computation as part of the pipeline). When you want to wait for the the process you just deref the future, which will either give you the result or block until the process completes.

I have a work in progress branch that adds support for the & to the parser. After that it should be just adding the future wrapping part to the compiler code.

What do you think? Is there maybe some use that would be missed out by such approach?