16

  • The Scala 2.10 release notes says this: "Akka Actors now part of the distribution. The original Scala actors are now deprecated."
  • The latest Akka library ("Akka 2.1.0 for Scala 2.10") mentions the following dependency:          com.typesafe.akka:akka-actor_2.10:2.1.0
       and the following examples:
             import akka.actor.Actor
             class MyActor extends Actor {..}
             val system = ActorSystem("MySystem")

  • My project includes these libraries:
             org.scala-lang:scala-library:2.10.0
             org.scala-lang:scala-actors:2.10.0
  • In my classpath, I have no package called "akka". I do see instead scala.actors, but it doesn't seem deprecated.

    So, in which way are Akka Actors "part of the distribution"?
    If this is, indeed, the case, then am I still supposed to add the "akka-actor_2.10" library as a dependency?
    If so, do I use akka.Actor or the non-deprecated scala.actors.Actor ?

    teo
    • 1,393
    • 1
    • 15
    • 25
    • 5
      You see them because scala-actors will be wiped out only in 2.10.1, I do believe that [this link](http://docs.scala-lang.org/overviews/core/actors-migration-guide.html) will answer most of your questions. – om-nom-nom Feb 12 '13 at 14:29
    • It tells me why scala.actors are not deprecated. But I don't have any code using Actors at this moment (hence, nothing to migrate). I just want to use actors in scala. Can I take from this that Akka actors are in fact NOT(yet) part of the 2.10.0 scala distribution? – teo Feb 12 '13 at 14:36
    • 2
      In fact, it tells also that *In Scala 2.10.0 actors reside inside the Scala distribution as a separate jar ( scala-actors.jar ), and the their interface is deprecated. The distribution also includes Akka actors in the akka-actor.jar. Future major releases of Scala will not contain Scala actors and the AMK. The AMK is built to work only with Akka actors version 2.1 which are included in the Scala distribution....* Given that, I think you should stick with Akka actors bundled with scala in a form of akka-actor.jar which you have to put on classpath. – om-nom-nom Feb 12 '13 at 14:40
    • Oh, I see. My understanding of "scala distribution" was wrong (for some reason, I thought that the "scala distribution" is given by artifacts from the group "org.scala-lang" - which, of course, is incorrect). It didn't occur to me to look in the downloaded scala *DISTRIBUTION* :) Makes sense, thank you! – teo Feb 12 '13 at 14:53

    1 Answers1

    14

    In scala 2.9.2 scala actors was part of scala-library.jar.

    If you download a scala-2.10.0 distribution it there are no actors in scala-library and both akka-actors.jar and scala-actors.jar are supplied.

    The latter is present for backwards compatibility and will be removed in a future major release.

    akka-actors is the replacement and what you should use for any new development (and look to move anything using scala-actors across when possible).

    If you have no current code in your project using actors you should probably reconfigure your project's dependencies to remove org.scala-lang:scala-actors:2.10.0 and instead depend on com.typesafe.akka:akka-actors_2.10:2.1.0 if you want to use actors.

    I am not sure why there's no deprecation annotation on the classes in scala-actors in 2.10.0 but I believe it's to be added in 2.10.1.

    You can find more info on the migration guide.

    Brian Smith
    • 3,383
    • 30
    • 41
    • Cool, so akka-actors is the alternative to the soon-to-be-deprecated scala-actors. I should have, indeed, read the migration guide - but I kept away from it because technically I didn't need to migrate anything. Thanks! – teo Feb 12 '13 at 15:07