Skip to content

Instantly share code, notes, and snippets.

@leifwickland
Created June 6, 2011 14:57
Show Gist options
  • Save leifwickland/1010403 to your computer and use it in GitHub Desktop.
Save leifwickland/1010403 to your computer and use it in GitHub Desktop.
Example of using futures to schedule work for later
import scala.actors.Futures
(Futures.awaitAll(9999999,1.to(100000).map(x => Futures.future{Thread.currentThread.getName}): _*).foldLeft(Set[String]()) {(set, name) => set + name.get.toString}).foreach(println);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment