Skip to content

Instantly share code, notes, and snippets.

@frankie-loves-jesus
Created June 9, 2014 04:40
Show Gist options
  • Save frankie-loves-jesus/7354ab52c2049d496361 to your computer and use it in GitHub Desktop.
Save frankie-loves-jesus/7354ab52c2049d496361 to your computer and use it in GitHub Desktop.
task :test do
array = [
"lorem",
"ipsum",
"dolor"
]
array.each do |word|
# http://stackoverflow.com/questions/2504445/spawn-a-background-process-in-ruby
process = fork do
# word = puts word
sleep rand(1..5)
system "echo #{word}"
end
Process.detach(process)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment