There are currently 2 Scala-IO 0.4 releases.
- Scala-io 0.4-seq - A version of Scala 0.4 without the Akka dependency and therefore no ASync support
- Scala-io 0.4 - The full version that contains an Akka dependency
The Scala 2.10 versions will have no Akka dependency but can optionally use Akka.
So getting started:
Download the example project on the docs website (http://jesseeichar.github.com/scala-io-doc/latest):
- Go to Getting Started and follow instructions for downloading and running the example project. The following goes through the steps for the 0.4.1 instructions.
1 2 3 4 5 6 7 8 9 10 11 12 13 | sbt console scala > import scalax.io. _ import scalax.io. _ scala > import java.net.URL import java.net.URL | lines().async.size.onComplete(println) res 3 : akka.dispatch.Future[Int] = akka.dispatch.DefaultPromise @ 363 adfb 4 scala > Right( 770 ) |
The last line (Right(770)) is not a command to enter; it is the result of the asynchonous call.