Skip to content

Instantly share code, notes, and snippets.

@moreindirection
Created May 17, 2011 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moreindirection/977255 to your computer and use it in GitHub Desktop.
Save moreindirection/977255 to your computer and use it in GitHub Desktop.
Poor Man's Dataflow
import actors.Futures.future
object PoorMansDataflow {
def main(args : Array[String]) {
// ....
val pastSales = future(db.getTotalSales)
val todaysSales = future(input.map(parseReport(_)).sumBy(_.totalSold))
printf("Total sales: %d\n", pastSales.apply() + todaysSales.apply())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment