isExistLocalActorRef method

Future<bool> isExistLocalActorRef(
  1. String path
)

Checks if the register exist a reference to an actor with path - path.

You have two way how point out path to actor:

  • relative;
  • absolute.

The relative path is set from current actor.

For example current actor has the name "my_actor", you can point out this path "system/root/user/my_actor/my_child" like "../my_child".

Absolute path given by the full path to the actor from the name of the system of actors.

Implementation

Future<bool> isExistLocalActorRef(String path) async {
  var actorPath = _parcePath(path);

  var receivePort = ReceivePort();

  _actorProperties.actorSystemMessagePort.send(
      ActorSystemIsExistUserLocalActorRef(actorPath, receivePort.sendPort));

  var result =
      await receivePort.first as ActorSystemIsExistLocalActorRefResult;

  receivePort.close();

  return result.isExist;
}