Scala Async: A New Way to Simplify Asynchronous Code (Make the Compiler Do It!)


Download (PDF, 8.94MB)

From the abstract: “Ever wished the compiler could make asynchronous programming easier? Enter Scala Async. Do asynchronous I/O like ‘normal’ blocking I/O, program with Futures and Promises even more naturally! Scala Async makes it possible to ‘suspend’ at arbitrary points in a block of regular Scala code, and to ‘resume’ from that point later— all without blocking. This not only makes it possible to make concurrent code look sequential, it makes it possible to actually use even the most unfamiliar asynchronous libraries in a familiar blocking style. What’s more, not only does it come out-of-the-box seamlessly integrated with Scala 2.10’s new Futures and Promises API, but you can also easily use it with any other event-driven Scala or Java library of your choice, like Java NIO, Twitter’s Finagle, or Dispatch.”