Akka.Remote.RemoteSystemDaemon.RemoveChildParentNeedsUnwatch C# (CSharp) Метод

RemoveChildParentNeedsUnwatch() приватный Метод

private RemoveChildParentNeedsUnwatch ( IActorRef parent, IActorRef child ) : bool
parent IActorRef
child IActorRef
Результат bool
        private bool RemoveChildParentNeedsUnwatch(IActorRef parent, IActorRef child)
        {
            const bool weDontHaveTailRecursion = true;
            while (weDontHaveTailRecursion)
            {
                IImmutableSet<IActorRef> children;
                if (!_parent2Children.TryGetValue(parent, out children)) 
                    return false; //parent is missing, so child does not need to be removed

                if (_parent2Children.TryUpdate(parent, children.Remove(child), children))
                    return true; //child was removed
            }
        }
    }