-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actor's parent address #42
Comments
That information is currently not exposed to the Actor itself, so your methodology of a message send from the parent is the recommended Thespian solution. There is no fundamental reason for not providing this to the Actor other than simplicity. Most of the scenarios I've encountered to-date where the child needed to know the parent's address also involved passing some information from the parent to the child, so an initial message was needed anyhow. |
Well, thank you for explanations. I think you may consider adding such feature in the future. It may be very beneficial for the users. The present situation may be a bit confusing, because a child actor actually has no link to its parent as long as it doesn't receive any message form it. Also - from the child actor perspective - how do you know that the "Setup" message came from the parent ? Or even any message ? Without knowing your parent's address you don't know. The only solution that comes to my mind is to ensure that the first message always comes from the parent. Then you can store it and use it. But during writing tests one may accidentally forgot about this constraint and cause some harm. Also, this seem to put pressure on the thespian lib client as he is forced to write extra code. |
Thank you! I appreciate the suggestion and I will look into adding this
as a feature in the near future.
…-Kevin
Pawel Lampe writes:
Well, thank you for explanations.
I think you may consider adding such feature in the future. It may be very beneficial for the users. The present situation may be a bit confusing, because a child actor actually has no link to its parent as long as it doesn't receive any message form it. Also - from the child actor perspective - how do you know that the "Setup" message came from the parent ? Or even any message ? Without knowing your parent's address you don't know. The only solution that comes to my mind is to ensure that the first message always comes from the parent. Then you can store it and use it. But during writing a tests one may accidentally forgot about this constraint and cause some harm. Also, this seem to put pressure on the thespian lib client as he is forced to write extra code.
|
I am agree, this feature will be useful. |
I did some research (docs + google + lib reverse engineering) but I can’t find an answer for my question: is there any way for the child actor to get its parent address ? At the moment I must introduce a “Setup” or “Initialize” message in my code and utilize “sender”. But I guess there is some other way.
If there is no such feature, then my question is: why ? Previously I’ve been using Akka for Scala, and there is such possibility, so I assume it makes some sense from the actors model POV.
I will appreciate any answer .
The text was updated successfully, but these errors were encountered: