Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When one should call resetProxy and clearSelf methods of Actor?

Tags:

scala

actor

This is a followup of my previous question. When one should invoke resetProxy and clearSelfof Actor ? What are they actually useful for?

like image 598
Michael Avatar asked Aug 15 '11 14:08

Michael


1 Answers

These methods are used when a "regular" thread ( not threads executing actors ) is talking to an actor. Since there isn't a proper actor sending a message to another actor a proxy actor is instantiated for the thread. You should use the clearSelf method when a thread is long lived and periodically talks to actors especially threads from a thread pool. This method clears the proxy actor created for the thread to have a conversation with other actors so it should be called at the end of an actor dialog. resetProxy is useful when you suspect a proxy actor has died during a dialog and plan to retry.

like image 88
Neil Essy Avatar answered Sep 28 '22 08:09

Neil Essy