Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication error within child

Hi,

      I have created a project using actor framework concept. I have one actor and two childrens, the actor is usually a set of user events and childrens are daq and visual. The communication from actor to childrens and vice versa works fine. The problem is that, there are few commands that needs to shared within childrens (within daq and visual). This part i'm not able to communicate properly. Please help me how to proceed further.

0 Kudos
Message 1 of 2
(3,254 Views)

I assume when you say "children" you mean "nested actors", otherwise "communication between actor and children" doesn't make sense.

You have the following options:

1. send what you need to the calling actor and have the calling actor route the messages to the correct nested actor. the advantage is that it decouples the children and allows one place that all messages go through (the main actor) which is useful for logging and debugging. The disadvantage is htat you need two sets of messages - from A to main and main to B, etc.

2. Send child1 the reference to child2 and vice versa and have them send messages to each other. This increases coupling between the nested actors but is quick and easy to code.

3. If applicable to your application, use a method like the "self addressed envelope":part of the message would be the actor ref to return the reply to, or use abstract messages.

Without knowing more about your application it's difficult to say more.

Good luck,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 2 of 2
(2,810 Views)