コード例 #1
0
        private void Handle(ClusterActorDiscoveryMessage.ActorDown m)
        {
            _log.Info($"Table.ActorDown (Actor={m.Actor.Path})");

            if (_table.Equals(m.Actor))
            {
                _table = null;
            }
            else
            {
                _log.Error($"But I have a different table. (Actor={_table.Path})");
            }

            // TODO: Shutdown all actors
        }
コード例 #2
0
        private void Handle(ClusterActorDiscoveryMessage.ActorDown m)
        {
            _log.Info($"Container.ActorDown (Actor={m.Actor.Path})");

            if (_containerMap.TryGetValue(m.Actor, out var container) == false)
            {
                _log.Error($"I don't have that container. (Actor={m.Actor.Path})");
                return;
            }

            _containerMap.Remove(m.Actor);
            RebuildContainerWorkQueue();

            // Remove all actors owned by this container

            foreach (var(key, actorRef) in container.ActorMap)
            {
                _actorMap.Remove(key);
                if (actorRef != null)
                {
                    continue;
                }

                // cancel all pending creating requests

                if (!_creatingMap.TryGetValue(key, out var creating))
                {
                    continue;
                }

                _creatingMap.Remove(key);

                foreach (var r in creating.Requesters)
                {
                    r.Item1.Tell(CreateReplyMessage(r.Item2, key, null, false));
                }
            }

            // When stopping done, ingest poison pill

            if (_stopping && _containerMap.Count == 0)
            {
                Context.Stop(Self);
            }
        }
コード例 #3
0
        private void Handle(ClusterActorDiscoveryMessage.ActorDown m)
        {
            _log.Info($"Table.ActorDown (Actor={m.Actor.Path})");

            if (_table.Equals(m.Actor) == false)
            {
                _log.Error($"But I have a different table. (Actor={_table.Path})");
                return;
            }

            _table = null;

            CancelAllPendingAddRequests();

            foreach (var i in _actorMap)
            {
                i.Value.Tell(_downMessage ?? PoisonPill.Instance);
            }

            // NOTE: should we clear actor map or let them to be removed ?
        }