1. yes
2. not exactly: it’s not possible to become a parent by looking up an actor, 
because each actor gets started by a parent actor (if you use 
ActorSystem.actorOf the system actor called guardian will be the parent)

So, one possible solution: Your parent actor watches its children which are 
deployed remotely; it also watches cluster events, in particular MemberUp; once 
it detects that too many children have died and there are spare remote cluster 
members nodes, it creates new children on these remote member nodes. BTW, 
that’s more or less what a cluster based pool router does, so you might not 
have to handle that yourself ...

Heiko

--

Heiko Seeberger
Home: heikoseeberger.de <http://heikoseeberger.de/>
Twitter: @hseeberger <https://twitter.com/hseeberger>
Public key: keybase.io/hseeberger <https://keybase.io/hseeberger>
> On 22 Jun 2015, at 21:24, Harit Himanshu <[email protected]> 
> wrote:
> 
> Thanks a lot Heiko, That makes lot of sense.
> 
> So as I understand
> If the JVM (where child actor resides) terminates(or crashes), no supervision 
> applies.
> The only way to recover then would be to start the process (JVM) with 
> ChildActor again(manually or some other way) and parent Actor (in separate 
> JVM) looks up for it and starts watching it again
> Correct me if this understanding is wrong
> 
> Thank you
> + Harit Himanshu
> 
> On Mon, Jun 22, 2015 at 12:08 PM, Heiko Seeberger <[email protected] 
> <mailto:[email protected]>> wrote:
> You seem to confuse failure and termination. Failure happens when an actor 
> throws an exception, e.g. during handling a message. Then it gets suspended 
> and its parent needs to decide what to do, e.g. restart. Termination happens 
> when an actor gets stopped, e.g. by itself, or – in the case of removing – 
> when the remote failure detector decides that the other side is no longer 
> reachable, which of course happens when the other JVM crashes. Termination 
> has nothing to do with supervision, though the parent could watch the 
> lifecycle of its children by calling `context.watch`. Hoping that helps.
> 
> Heiko
> 
> --
> 
> Heiko Seeberger
> Home: heikoseeberger.de <http://heikoseeberger.de/>
> Twitter: @hseeberger <https://twitter.com/hseeberger>
> Public key: keybase.io/hseeberger <https://keybase.io/hseeberger>
> --
> 
> Heiko Seeberger
> Home: heikoseeberger.de <http://heikoseeberger.de/>
> Twitter: @hseeberger <https://twitter.com/hseeberger>
> Public key: keybase.io/hseeberger <https://keybase.io/hseeberger>
>> On 22 Jun 2015, at 20:36, Harit Himanshu <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Hello
>> 
>> I am learning Remoting and have a question. I am looking at example where 
>> remote actor is created programmatically. As per the typesafe activator 
>> sample, I read 
>> 
>> "Error handling, i.e. supervision, works exactly in the same way as if the 
>> child actor was a local child actor. In addtion, in case of network failures 
>> or JVM crash the child will be terminated and automatically removed from the 
>> parent even though they are located on different machines."
>> 
>> Question (assuming parent and child are on separate JVMs)
>> If the child actor crashes the JVM(where it lived) and supervision strategy 
>> on parent(on a different JVM) is to Restart, will it start the entire 
>> ActorSystem for Child Actor? I guess not because ActorSystem was started as 
>> a separate process (by command-line).
>> If 1. is true, how can we recover the Child Actor since the entire Actor 
>> System (where Child Actor lived) crashed?
>> Thank you
>> + Harit Himanshu
>> 
>> -- 
>> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
>> >>>>>>>>>> Check the FAQ: 
>> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
>> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
>> >>>>>>>>>> <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] 
>> <mailto:[email protected]>.
>> To post to this group, send email to [email protected] 
>> <mailto:[email protected]>.
>> Visit this group at http://groups.google.com/group/akka-user 
>> <http://groups.google.com/group/akka-user>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <https://groups.google.com/group/akka-user>
> --- 
> 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/SQF0wiObHGY/unsubscribe 
> <https://groups.google.com/d/topic/akka-user/SQF0wiObHGY/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/akka-user 
> <http://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/akka-user 
> <http://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to