This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Actor library change in 2.8

3 replies
Alexey Ermakov
Joined: 2010-09-06,
User offline. Last seen 42 years 45 weeks ago.
Hi,
We're in the process of rewriting our application (that heavily uses actors) to 2.8, and I've noticed an incompatible change:Actor#exit() is now "def protected[actors]" (was public). This change breaks the code that uses anonymous actors created with "actor { … }", leaving no clean way of shutting down such actors. Besides, it contradicts the documentation: scaladoc for self states that it "should be used instead of this in all blocks of code executed by actors", and there's currently no way to cleanly shutdown an loop()ing actor other than calling this.exit(). What's the rationale behind this change?
Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Re: Actor library change in 2.8
Try Actor.exit, the method on the Actor companion object, which is still public.

On Mon, Sep 6, 2010 at 8:28 AM, Alexey Ermakov <zee@technocore.ru> wrote:
Hi,
We're in the process of rewriting our application (that heavily uses actors) to 2.8, and I've noticed an incompatible change: Actor#exit() is now "def protected[actors]" (was public). This change breaks the code that uses anonymous actors created with "actor { … }", leaving no clean way of shutting down such actors. Besides, it contradicts the documentation: scaladoc for self states that it "should be used instead of this in all blocks of code executed by actors", and there's currently no way to cleanly shutdown an loop()ing actor other than calling this.exit(). What's the rationale behind this change?



--
http://erikengbrecht.blogspot.com/
Alexey Ermakov
Joined: 2010-09-06,
User offline. Last seen 42 years 45 weeks ago.
Re: Actor library change in 2.8
Thanks, didn't notice it for some reason.Still, what's the rationale behind the change? I don't really see the point of leaving react, receive and the rest public, but hiding exit.

On Mon, Sep 6, 2010 at 4:31 PM, Erik Engbrecht <erik.engbrecht@gmail.com> wrote:
Try Actor.exit, the method on the Actor companion object, which is still public.

On Mon, Sep 6, 2010 at 8:28 AM, Alexey Ermakov <zee@technocore.ru> wrote:
Hi,
We're in the process of rewriting our application (that heavily uses actors) to 2.8, and I've noticed an incompatible change: Actor#exit() is now "def protected[actors]" (was public). This change breaks the code that uses anonymous actors created with "actor { … }", leaving no clean way of shutting down such actors. Besides, it contradicts the documentation: scaladoc for self states that it "should be used instead of this in all blocks of code executed by actors", and there's currently no way to cleanly shutdown an loop()ing actor other than calling this.exit(). What's the rationale behind this change?



--
http://erikengbrecht.blogspot.com/

Ichthyostega
Joined: 2010-09-11,
User offline. Last seen 42 years 45 weeks ago.
Re: Actor library change in 2.8

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexey Ermakov schrieb:
> Thanks, didn't notice it for some reason. Still, what's the rationale behind
> the change? I don't really see the point of leaving react, receive and the
> rest public, but hiding exit.

just guessing here, but maybe its because "Actor.exit()" expresses
your intent way clearer than just "exit()". Especially because that
call typically is nested somewhere in a case clause within react {..}

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkyKWGMACgkQZbZrB6HelLJurQCfasFe/l7EqF4Wq0wFIaTCYCoI
uF8AnAtjg8RacXXmT6ltGDjU6BjAcDjL
=ec+j
-----END PGP SIGNATURE-----

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland