- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
semantics of suspending actor operations for ActorProxy
Thu, 2009-05-21, 05:11
By "suspending operations" I mean ops that cause an exception to be thrown that would normally return control from "user code" to the actor library by being handled in Reaction, such as react, reactWithin, loop, etc. Currently these operations blow away the current thread because the exception goes unhandled, and the ActorProxy is scheduled on the default scheduler to handle to perform actions. This doesn't seem like a very friendly behavior.
Different options are:1. Override these operations for ActorProxy so that they block or otherwise don't raise exceptions - this causes problems because most (all?) of these methods have a return type of Nothing, which means they aren't supposed to return 2. Let them destroy the thread, but attempt to cleanly handle them by registering an uncaught exception handler for the thread - this seems like the logical thing to do3. Throw an exception immediately when they are attempted because they are invalid for threads that aren't managed by the actor library 4. Leave it as it is, just make sure it doesn't result in any leaks
Thoughts?
-Erik
Different options are:1. Override these operations for ActorProxy so that they block or otherwise don't raise exceptions - this causes problems because most (all?) of these methods have a return type of Nothing, which means they aren't supposed to return 2. Let them destroy the thread, but attempt to cleanly handle them by registering an uncaught exception handler for the thread - this seems like the logical thing to do3. Throw an exception immediately when they are attempted because they are invalid for threads that aren't managed by the actor library 4. Leave it as it is, just make sure it doesn't result in any leaks
Thoughts?
-Erik
On Wed, May 20, 2009 at 9:11 PM, Erik Engbrecht <erik.engbrecht@gmail.com> wrote:
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp