Last active
August 29, 2015 13:57
-
-
Save tieleman/9482542 to your computer and use it in GitHub Desktop.
Spawn example
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
pid1 = spawn "some_command" | |
pid2 = spawn "some_other_command" | |
pid1.on_exit do |status| | |
puts "Process #1 exited with status code #{status}, aborting." | |
exit | |
end | |
pid2.on_exit do |status| | |
puts "Process #2 exited with status code #{status}, aborting." | |
exit | |
end | |
Process.waitall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment