Skip to content

Instantly share code, notes, and snippets.

@glurp
Created August 12, 2011 15:24
Show Gist options
  • Save glurp/1142278 to your computer and use it in GitHub Desktop.
Save glurp/1142278 to your computer and use it in GitHub Desktop.
Paralelle map
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