killChild method

Future<void> killChild(
  1. String path
)

Kills child with path.

Kills child actor isolate, but does not delete him mailboxe, does not remove child actor from the actor system.

You can rerun him.

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<void> killChild(String path) async {
  var actorPath = _parcePath(path);

  var actorCell = _findChild(actorPath);

  if (actorCell != null) {
    await actorCell.kill();
  } else {
    throw ActorContextException(
        message:
            'actor has no child with path ' + actorPath.toString() + '.');
  }
}