This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use jobd.nu | |
| # Start background jobs | |
| jobd spawn "background-job1" { bash -c 'while [ true ]; do echo "background running"; sleep 5; done' } | |
| jobd spawn "background-job2" --restart { bash -c 'sleep 5' } | |
| # Start main job we want to wait for | |
| jobd spawn "main-job" { bash -c 'sleep 20' } | |
| # Wait for main job to be done, end all other jobs when this happens | |
| jobd wait "main-job" --end |