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

Good Actor Style

No replies
nathan s
Joined: 2011-03-31,
User offline. Last seen 42 years 45 weeks ago.

Hi all,
I'm putting together some actor functionality and had a question
about
'good style'. In reading "Programming In Scala" it mentions non-
blocking actors as being essential in having 'good actor style'. The
book recommends using helper actors to prevent non-blocking. From my
understanding of this and perhaps I'm dead wrong I came up with the
following pseudo implementation:
object MyActor extends Actor{
def someMethod = {
actor{
//implementation here
}
}
loop{
react{
case _ => someMethod
}
}
}

Now, again from my understanding the actor won't block, but haven't I
circumvented the non-threaded style inherent with using react by
creating an actor thread anyway when I call someMethod?
Thanks for advice on this.
nathan

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