Mega Code Archive

 
Categories / Ruby / Development
 

Use Process wait to wait for all child processes to finish before continuing

child = fork do   sleep 3   puts "Child says 'hi'!" end puts "Waiting for the child process..." Process.wait child puts "All done!"