phactor icon indicating copy to clipboard operation
phactor copied to clipboard

Supervision Trees

Open tpunt opened this issue 8 years ago • 1 comments

Work on supervision trees has begun in the supervision-trees branch. The API I currently have in mind looks as follows:

final class Supervisor
{
    public const ONE_FOR_ONE = 0;

    public function __construct(ActorRef|string $supervisor[, int $strategy]);

    // Add a pre-existing actor to the group of supervised workers
    public function addWorker(ActorRef|string $worker) : void;

    // Creates a new actor, links it to the supervisor, and return its actor reference
    // This should be used if the actor's constructor may throw an exception
    public function newWorker(string $actorClass[, array $ctorArgs[, string $actorName]]) : ActorRef;
}

To do list:

  • [x] Prevent the supervision tree from containing cycles
  • [x] Work out what the semantics should be for a crashing supervisor

tpunt avatar Mar 03 '18 12:03 tpunt

The basic implementation from the supervision-trees branch has been merged. I'm leaving this issue open because there is still much work to be done on the supervision trees feature.

tpunt avatar Mar 15 '18 17:03 tpunt