Is it bad practice to send an actor a message from something which is not an actor?

后端 未结 2 2057
礼貌的吻别
礼貌的吻别 2020-12-16 19:34

Suppose I have some class which has a property actor_ of type Actor. Is there a problem with me doing

def someMethod() = {
  actor_         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-16 19:42

    I don't see a problem with doing that. If it makes sense in your code, then why not? If you look at the pure actor model everything is an actor and only actors are communicatinng with each other, if you can design your code like this..great..if you can't or don't want to then it's ok to send messages from non-actors to actors.

提交回复
热议问题