Skip to content

Instantly share code, notes, and snippets.

@anderseriksson
Created April 11, 2012 21:01
Show Gist options
  • Save anderseriksson/2362555 to your computer and use it in GitHub Desktop.
Save anderseriksson/2362555 to your computer and use it in GitHub Desktop.
Parallell top 5 using aggregate
(1 to 10000000).par.aggregate( List[Int]() ) ( (list: List[Int], b: Int ) => (list:+b).sortWith(_>_).take(5) , (a: List[Int], b: List[Int]) => (a ::: b).sortWith(_>_).take(5) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment