Sorry for such late reply. Exam period. Didn't check ML. Will reply as
somebody might stumble upon this.
I did GSoC work for Scala/Akka (will do thesis from it in the coming
weeks).
I only use Akka I imagine it works the same for Scala Actors. I'd
recommend using Akka - more of everything. ;)
In Akka you can do (Scala Actors similar code):
class MyActor @Inject (foo:Foo, bar:Bar) extends Actor {
@Inject baz:Baz = null
def receive = {
....
}
}
You have ctor, field and method injection just like in Java.
You then need to manually call the injector
val actorRef = actorOf(injector.getInstance(classOf[MyActor])).start()
There is nothing special about the actor instance itself. What is
special is how they communicate with each other.
You can also do AOP in your Actor as Guice is creating the instance.
Just keep in mind intercepting receive will actually intercept the
"partial function" and not the actual "receive".
Cheers
Alen