Ejemplo n.º 1
0
        private void AddWatching(IActorRef watchee, IActorRef watcher)
        {
            _watching.Add(Tuple.Create(watchee, watcher));
            var watcheeAddress = watchee.Path.Address;

            if (!_watchingNodes.Contains(watcheeAddress) && _unreachable.Contains(watcheeAddress))
            {
                // first watch to that node after previous unreachable
                _unreachable.Remove(watcheeAddress);
                _failureDetector.Remove(watcheeAddress);
            }
            _watchingNodes.Add(watcheeAddress);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="watchee">TBD</param>
        protected virtual void WatchNode(IInternalActorRef watchee)
        {
            var watcheeAddress = watchee.Path.Address;

            if (!WatcheeByNodes.ContainsKey(watcheeAddress) && Unreachable.Contains(watcheeAddress))
            {
                // first watch to a node after a previous unreachable
                Unreachable.Remove(watcheeAddress);
                _failureDetector.Remove(watcheeAddress);
            }

            if (WatcheeByNodes.TryGetValue(watcheeAddress, out var watchees))
            {
                watchees.Add(watchee);
            }
            else
            {
                WatcheeByNodes.Add(watcheeAddress, new HashSet <IInternalActorRef> {
                    watchee
                });
            }
        }