Created
          June 9, 2014 04:40 
        
      - 
      
 - 
        
Save frankie-loves-jesus/7354ab52c2049d496361 to your computer and use it in GitHub Desktop.  
  
    
      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
    
  
  
    
  | 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