--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
I guess that's the why of question 2. Im not clear when the different lifecycle phases, like preStart, occur.I would assume preStart occurs after object construction, and is asynchronous to the system call used to create the actor, is that not so?
val subsys = new SubSys()
val a = system.actorOf(Props(classOf[MyActor], subsys)) // constructor registers with subsys
subsys.go()I would if it told me when that chain of events starts and stops relative to the actorOf call itself.
My actor needs to register with another non-actor subsystem before i interact with it, so If i write code like...val subsys = new SubSys()
val a = system.actorOf(Props(classOf[MyActor], subsys)) // constructor registers with subsys
subsys.go()There is a race condition as the constructor for my actor doesn't get called before .go().
Well, for the integration points, assuming you need a response, uaing ask is a very good approach.
I think the Play framework takes tgis approach.
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/69j5j77t87E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
class MyActor(p: Promise[ActorRef]) extends Actor {
override def preStart() {
p.complete(Success(self))
}
override def receive = {
case x => println(x)
}
}
val system = ActorSystem("system1")
val promise = Promise[ActorRef]
system.actorOf(Props(classOf[MyActor], promise))
val actor = Await.result(promise.future, 10 seconds)