Do you mean that the state of the outer actor can be used from the inner actor by mistake? It sounds a little nonsensical to me to use one actor from another directly (not by sending a message). среда, 14 декабря 2016 г., 19:25:35 UTC+3 пользователь Akka Team написал: > > I think it refers to that you could by mistake pass/close over mutable > internal state of the outer actor (ActorContext for example) to the inner > actor which would result in race conditions. > > -- > Johan > Akka Team > Lightbend <http://www.lightbend.com/> - Reactive apps on the JVM > Twitter: @akkateam > > On Wed, Dec 14, 2016 at 11:13 AM, Dmb <[email protected] <javascript:>> > wrote: > >> As explained in the documentation >> <http://doc.akka.io/docs/akka/2.4/scala/actors.html#Dangerous_Variants> it's >> dangerous to create an actor within another actor using the following >> variant: >> val props7 = Props(new MyActor) >> >> The explanation for this is the following (as given in the documentation) >> >> This method is not recommended to be used within another actor because it >>> encourages to close over the enclosing scope, resulting in non-serializable >>> Props and possibly race conditions (breaking the actor encapsulation). >> >> >> How does it cause *Props* to become non-serializable? And where is the >> race condition? I cannot see how breaking encapsulation implies race >> condition. >> >> Couldn't you expand this a little more? >> >> -- >> >>>>>>>>>> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > >
-- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
