Skip to content

Instantly share code, notes, and snippets.

@tieleman
Last active August 29, 2015 13:57
Show Gist options
  • Save tieleman/9482542 to your computer and use it in GitHub Desktop.
Save tieleman/9482542 to your computer and use it in GitHub Desktop.
Spawn example
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