0

Assume I have two IActorRef pointing to the same actor but obtained from different sources:

One actor reference was obtained during local creation of an actor:

var actorRef1 = system.ActorOf<MyActor>("myActor");

Later this actor reference was passed to a remote actor, and after the same actor reference was returned back (as an actorRef2 for example).

Are the two actor references test for equality?

Object.Equals(actorRef1, actorRef2); // true???

Or another case: two IActorRef were received from different remote systems, and pointing to a same actor on another remote system.

Sergey Kostrukov
  • 1,143
  • 15
  • 24

1 Answers1

3

This question was answered via gitter chat. But ill post it here as well for posterity.

IActorRef's are equatable, they are compared via their actorpath and UID. So even if 2 actorrefs are acquired through different means, they will still be equal if they point to the same actor.

Danthar
  • 1,068
  • 7
  • 13