diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -4,6 +4,24 @@ Note: this branch targets Scala 2.11.x, support for Scala 2.10.x has been moved ## Quick start +To include scala-async in an existing project use the library published on Maven Central. +For sbt projects add the following to your build definition - build.sbt or project/Build.scala: + +```scala +libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.5" +``` + +For Maven projects add the following to your <dependencies> (make sure to use the correct Scala version prefix, _2.10 or _2.11, +to match your project’s Scala version): + +```scala +<dependency> + <groupId>org.scala-lang.modules</groupId> + <artifactId>scala-async_2.11</artifactId> + <version>0.9.5</version> +</dependency> +``` + After adding a scala-async to your classpath, write your first `async` block: ```scala @@ -97,7 +115,8 @@ The `async` approach has two advantages over the use of The existing continuations (CPS) plugin for Scala can also be used to provide a syntactic layer like `async`. This approach has been -used in Akka's [Dataflow Concurrency](http://doc.akka.io/docs/akka/snapshot/scala/dataflow.html) +used in Akka's [Dataflow Concurrency](http://doc.akka.io/docs/akka/2.3-M1/scala/dataflow.html) +(now deprecated in favour of this library). CPS-based rewriting of asynchronous code also produces a closure for each suspension. It can also lead to type errors that are |