Created
August 12, 2011 15:24
-
-
Save glurp/1142278 to your computer and use it in GitHub Desktop.
Paralelle map
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
pm=ParalleleMap.new( | |
:nbThread => 5, | |
:generator => proc { |res| | |
rfind("/" , ".rb" ) { |file| res << file ; } | |
}, | |
:mapper => proc { |out,in_file_name| | |
selectLine(out,query,in_file_name) | |
}, | |
:reducer =>proc { |rr| reduce(rr) }, | |
:debug => (debug!=nil) | |
) | |
#.... here can do other things | |
result=pm.get_result() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment