I am going to use Futures
and Promises
from scala.concurrent
package in Scala 2.10.1. Should I use Akka
instead ?
1 Answer
Akka futures and promises were moved into Scala standard library in 2.10 so there is no difference. It's not that you're using the standard scala classes - the old scala classes no longer exist and have been replaced by akka's.
Use akka actors as scala ones are deprecated in scala 2.11
See akka 2.0 to 2.1 migration for details of what is in the standard scala library now. http://doc.akka.io/docs/akka/2.1.2/project/migration-guide-2.0.x-2.1.x.html
Search Replace with
akka.dispatch.Await scala.concurrent.Await
akka.dispatch.Future scala.concurrent.Future
akka.dispatch.Promise scala.concurrent.Promise
akka.dispatch.ExecutionContext scala.concurrent.ExecutionContext
akka.util.Duration scala.concurrent.duration.Duration
akka.util.duration scala.concurrent.duration
akka.util.Deadline scala.concurrent.duration.Deadline
akka.util.NonFatal scala.util.control.NonFatal
akka.japi.Util.manifest akka.japi.Util.classTag
-
-
1Use the akka ones - in scala 2.11 scala actors are being deprecated. Updated my answer. PS akka rocks!!!!– JasonGMay 13, 2013 at 13:32
-
Thank you for the answer. It looks a bit inconsistent to use
scala.concurrent
for one API (Futures/Promises
) andakka
for another though.– MichaelMay 13, 2013 at 14:13 -
Look at the akka documentation and you'll see it's the same there. doc.akka.io/docs/akka/snapshot/scala/testing.html– JasonGMay 16, 2013 at 14:39
-
2Fyi - the advice here holds true: in scala 2.10.2 scala actors are officially deprecated and the akka actors now come bundled with scala. scala-lang.org/2.10.2-RC2– JasonGJun 2, 2013 at 14:27
Future
anymore.