Skip to content

Instantly share code, notes, and snippets.

@tcnksm
Created December 18, 2013 07:43
Show Gist options
  • Save tcnksm/231c1796c4a2522b73cc to your computer and use it in GitHub Desktop.
Save tcnksm/231c1796c4a2522b73cc to your computer and use it in GitHub Desktop.
Test concurrency by parallel rubygems
require 'parallel'
list = []
Parallel.each((1..10), in_threads:3 ){ |num|
p num
list << num
sleep 3
}
p list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment