-
-
Save tcnksm/231c1796c4a2522b73cc to your computer and use it in GitHub Desktop.
Test concurrency by parallel rubygems
This file contains 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
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