Akka.Actor.RepointableActorRef.Point C# (CSharp) Method

Point() public method

This method is supposed to be called by the supervisor in HandleSupervise() to replace the UnstartedCell with the real one. It assumes no concurrent modification of the `underlying` field, though it is safe to send messages at any time.
public Point ( ) : void
return void
        public void Point()
        {
            var underlying = Underlying;
            if (underlying == null)
                throw new IllegalStateException("Underlying cell is null");

            var unstartedCell = underlying as UnstartedCell;
            if (unstartedCell != null)
            {
                // The problem here was that if the real actor (which will start running
                // at cell.start()) creates children in its constructor, then this may
                // happen before the swapCell in u.replaceWith, meaning that those
                // children cannot be looked up immediately, e.g. if they shall become
                // routees.
                var cell = NewCell();
                SwapLookup(cell);
                cell.Start();
                unstartedCell.ReplaceWith(cell);
            }
            // underlying not being UnstartedCell happens routinely for things which were created async=false
        }