Thanks, Ivano! It helps!

On Thursday, October 2, 2014 4:17:25 PM UTC+8, pagoda_5b wrote:
>
> I think many details are missing, but the most simple thing that comes to 
> mind is 
>
> 1. create the controller actor from the gui, holding a reference to the 
> ActorRef (you can even inject this in the GUI to decouple the twos)
> 2. right after creation, send a reference of the gui object (using this) 
> to the controller actor, which will in turn hold it as a local reference
> 3. watch out the GC for possible memory leaks
>
> Ivano
>
> On Thursday, October 2, 2014 2:30:03 AM UTC+2, Qi Qi wrote:
>>
>> Hello, there is a puzzling situation for me to enable interaction between 
>> a controller(an akka actor) and a gui. The controller and the gui have to 
>> refer to each other inside their bodies. But if I parameterise them in each 
>> other's class definition, then it will be a dilemma of creating them. 
>> Because the controller needs a gui as its input, and the gui needs a 
>> controller as its input too. what should I do to break the looping? Thanks.
>> By the way, the controller actor class used to be defined nested inside 
>> another trait, and I have pulled it out to be a top level class. 
>>
>>  
>>
>

-- 
>>>>>>>>>>      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