<p><pre><code> $ mkfifo ~/.jobqueue
$ parallel :::: ~/.jobqueue
</code></pre>
now, from another terminal:<p><pre><code> echo ls > ~/.jobqueue
</code></pre>
Tada!<p>for a remote job queue, use nc instead of a fifo<p>for a job queue with a buffer, use a file, and run
$ parallel :::: <(tail -f thefile)
you can even truncate the file from time to time.<p>Of course, this doesn't capture the context you are in, such as your current directory or the value of shell variables.
This stackoverflow answer[0] shows how you can queue jobs even after you start running other processes in your queue.
Essentially, you can do:<p><pre><code> sleep 2; echo "A" && sleep 2 ; echo "B" && sleep 2 ; echo "C"
# Quickly Ctrl-Z
fg && sleep 2 ; echo "D"
</code></pre>
and you will see A\nB\nC\nD\n slowly printed out in your terminal.<p>[0]: <a href="http://superuser.com/a/345455" rel="nofollow">http://superuser.com/a/345455</a>
Could you please add some usage examples or elaborate on when this tool would be useful? For example,<p>> building several targets of a Makefile<p>As opposed to `make && sudo make install` ?<p>> downloading multiple files one at a time<p>As opposed to `(wget url1 &) ; (wget url2 &)` ?<p>> or simply as a glorified `nohup`<p>As opposed to `nohup` ?
Which systems guarantee monotonic behavior for gettimeofday()? I can't think of any. I hope there's no behavior in nq which relies on monotonicity other than file naming, because otherwise you might run into some obscure issues.
How does this differ from task spooler:<p><a href="http://vicerveza.homeunix.net/~viric/soft/ts/" rel="nofollow">http://vicerveza.homeunix.net/~viric/soft/ts/</a>