Akka.Actor.ActorCell.AddressTerminated C# (CSharp) Method

AddressTerminated() protected method

protected AddressTerminated ( Akka.Actor.Address address ) : void
address Akka.Actor.Address
return void
        protected void AddressTerminated(Address address)
        {
            // cleanup watchedBy since we know they are dead
            MaintainAddressTerminatedSubscription(() =>
            {
                
                foreach (var a in _state.GetWatchedBy().Where(a => a.Path.Address == address).ToList())
                {
                    //_watchedBy.Remove(a);
                    _state = _state.RemoveWatchedBy(a);
                }
            });

            // send DeathWatchNotification to self for all matching subjects
            // that are not child with existenceConfirmed = false because we could have been watching a
            // non-local ActorRef that had never resolved before the other node went down
            // When a parent is watching a child and it terminates due to AddressTerminated
            // it is removed by sending DeathWatchNotification with existenceConfirmed = true to support
            // immediate creation of child with same name.
            foreach (var a in _state.GetWatching().Where(a => a.Path.Address == address))
            {
                ((IInternalActorRef)Self).SendSystemMessage(new DeathWatchNotification(a, true /*TODO: childrenRefs.getByRef(a).isDefined*/, true));
            }
        }