SO sorry for that :P work to long,losing my mind.
在 2014年12月5日星期五UTC+8下午11时41分58秒,Andrew James Ramirez写道: > > I think the UID wont change too :D > > I just reread the > > http://doc.akka.io/docs/akka/snapshot/scala/actors.html#Actor_Lifecycle > > and it states > > An actor incarnation is identified by the path *and a UID*. A restart >> only swaps theActor instance defined by the Props but the incarnation >> and hence the UID remains the same. >> > > But you are right if we are talking about a new actorOf > > After the incarnation is stopped, the path can be reused again by >> creating an actor with actorOf(). In this case the name of the new >> incarnation will be the same as the previous one but the UIDs will differ. > > > I hope someone could confirm this. I am gonna try making a test. > > > On Friday, December 5, 2014 8:15:05 PM UTC+8, 何品 wrote: >> >> after restart the per actorref is still valid ,actorRef will not change >> ,but the uid. >> >> 在 2014年12月5日星期五UTC+8下午6时13分37秒,Andrew James Ramirez写道: >>> >>> What if the actor injected had an exception and restarted? >>> >>> Will it have a new ActorRef?If so, then the previously ActorRef wont >>> work? >>> >>> >>> On Tuesday, November 25, 2014 11:39:48 PM UTC+8, Konrad Malawski wrote: >>>> >>>> That's how I'd do it as well. >>>> With he caveat that variable names should be lower case in Scala :-) >>>> >>>> If you'd need moer advanced things you can look at the cake pattern >>>> (that's pure scala, but sometimes gets a bit complicated). >>>> >>>> Hope this helps! >>>> >>>> On Tue, Nov 25, 2014 at 3:23 PM, Andrew James Ramirez < >>>> [email protected]> wrote: >>>> >>>>> Hi, >>>>> >>>>> What is the best way to do this? Currently what I'm doing is >>>>> >>>>> class MainActor(Dependency1:ActorRef, Dependency2:ActorRef) = { >>>>> def receive ={ >>>>> case TestMessage => >>>>> Dependency1 ! "Test" >>>>> } >>>>> >>>>> } >>>>> >>>>> object MainActor{ >>>>> def props(Dependency1:ActorRef, Dependency2:ActorRef) = Props( >>>>> classOf[MainActor], Dependency1, Dependency2) >>>>> } >>>>> >>>>> >>>>> >>>>> >>>>> val dependency1 = system.actorOf(Dependency1.props()) >>>>> val dependency2 = system.actorOf(Dependency2.props()) >>>>> >>>>> val mainActor = system.actorOf(MainActor.props(dependency1, d >>>>> ependency2)) >>>>> >>>>> mainActor ! "TestMessage" >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>>>>>>> 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 [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at http://groups.google.com/group/akka-user. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> Cheers, >>>> Konrad 'ktoso' Malawski >>>> hAkker @ Typesafe >>>> >>> -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
