Наследование: IAutoReceivedMessage, IPossiblyHarmful
            public override void HandleTerminationMessage(Terminated message)
            {
                this.PublishMessage(new ActorUnsubscribedMessage(message.ActorRef, true));
                _terminationMessages++;

                base.HandleTerminationMessage(message);
            }
        protected void ReceivedTerminated(Terminated t)
        {
            if (!_state.ContainsTerminated(t.ActorRef))
                return;

            _state = _state.RemoveTerminated(t.ActorRef); // here we know that it is the SAME ref which was put in
            ReceiveMessage(t);
        }
Пример #3
0
 protected void ReceivedTerminated(Terminated t)
 {
     if (_terminatedQueue.Contains(t.ActorRef))
     {
         _terminatedQueue.Remove(t.ActorRef); // here we know that it is the SAME ref which was put in
         ReceiveMessage(t);
     }
 }
Пример #4
0
        void OnChildTerminated(Terminated message)
        {
            if (!message.ActorRef.Equals(recipientParser))
            {
                Unhandled(message);
                return;
            }

            Context.PublishEvent(new RecipientsInitializationFailed(jobId, "Parsing failed"));
            Become(AwaitingInitialization);
        }
        private void HandleTerminated(Terminated terminatedMsg)
        {
            foreach(var userAddress in _userAddresses)
            {
                if(userAddress.Value.ActorReference.Path == terminatedMsg.ActorRef.Path)
                {
                    Self.Tell(new Messages.ChangeState(UserState.Offline, userAddress.Key));
                    break;
                }

            }
        }
 /// <summary>
 ///     Handles a Terminated message.
 /// </summary>
 /// <param name="message">The message.</param>
 public virtual void HandleTerminationMessage(Terminated message)
 {
 }
Пример #7
0
 public WrappedTerminated(Terminated terminated)
 {
     _terminated = terminated;
 }
        private void Handle(Terminated m)
        {
            _channelSet.Remove(m.ActorRef);

            if (_isStopped && _channelSet.Count == 0)
                Self.Tell(InterfacedPoisonPill.Instance);
        }
        private void OnChildTerminate(Terminated m)
        {
            lock (_boundActorLock)
            {
                var boundActor = UnbindActor(m.ActorRef);

                if (_closed)
                {
                    // all children stopped and it's time to stop self now
                    if (_closed && _boundActorMap.Any(i => i.Value.IsChildActor) == false)
                        Self.Tell(InterfacedPoisonPill.Instance);
                }
                else
                {
                    if (boundActor != null && boundActor.BindingFlags.HasFlag(ActorBindingFlags.StopThenCloseChannel))
                        Close();
                }
            }
        }
Пример #10
0
        /// <summary>
        ///     Receiveds the terminated.
        /// </summary>
        /// <param name="m">The m.</param>
        private void ReceivedTerminated(Terminated m)
        {
            if (terminatedQueue.Contains(m.ActorRef))
            {
                terminatedQueue.Remove(m.ActorRef);
                this.ReceiveMessage(m);
            }

            ////TODO: we can get here from actors that we just watch, we should not try to stop things if we are not the parent of the actor(?)
            //InternalActorRef child = Child(m.ActorRef.Path.Name);
            //if (!child.IsNobody()) //this terminated actor is a valid child
            //{
            //    Stop(child); //unhooks the child from the supervisor container
            //}
            //if (System.Settings.DebugLifecycle)
            //    Publish(new Debug(Self.Path.ToString(), Actor.GetType(),
            //        string.Format("Terminated actor: {0}", m.ActorRef.Path)));

            //
            
        }
        private void Handle(Terminated m)
        {
            _log.Debug($"Terminated: Actor={m.ActorRef.Path}");

            int[] counts;
            if (_actorWatchCountMap.TryGetValue(m.ActorRef, out counts) == false)
                return;

            if (counts[1] > 0)
            {
                _monitorItems.RemoveAll(w => w.Actor.Equals(Sender));
                counts[1] = 0;
            }

            if (counts[0] > 0)
            {
                var index = _actorItems.FindIndex(a => a.Actor.Equals(m.ActorRef));
                if (index != -1)
                {
                    var tag = _actorItems[index].Tag;
                    _actorItems.RemoveAt(index);

                    // tell monitors & other discovery actors that local actor down

                    NotifyActorDownToMonitor(m.ActorRef, tag);
                    foreach (var discoveryActor in _nodeMap.Keys)
                        discoveryActor.Tell(new ClusterActorDiscoveryMessage.ClusterActorDown(m.ActorRef));
                }
            }
        }
Пример #12
0
 public WrappedTerminated(Terminated t)
 {
     T = t;
 }
Пример #13
0
        private void RemoveTerminatedReferences(Terminated terminated)
        {
            var currentJobs = CurrentJobs.ToList();

            if (currentJobs.Any(x => x.Value.JobWorkerRef != null && x.Value.JobWorkerRef.Equals(terminated.ActorRef)))
            {
                var jobKey = CurrentJobs.First(x => x.Value.JobWorkerRef != null && x.Value.JobWorkerRef.Equals(terminated.ActorRef)).Key;
                _logger.Error("{0} : Remote connection [{1}] died", jobKey.JobInfo.Id, terminated.ActorRef);

                JobWorkerInfo workerInfo;
                if (CurrentJobs.TryGetValue(jobKey, out workerInfo))
                {
                    workerInfo.SetWorkerRef(null);
                    workerInfo.JobStatusUpdate.Status = JobStatus.Terminated;
                    CurrentJobs.AddOrUpdate(jobKey, workerInfo, (key, oldvalue) => workerInfo);
                }
            }
            else if (JobSubscribers.ContainsKey(terminated.ActorRef.Path.ToString()))
            {
                Context.Unwatch(terminated.ActorRef);
                IActorRef actor;
                JobSubscribers.TryRemove(terminated.ActorRef.Path.ToString(), out actor);
                _logger.Error("JobSuscriber: Remote connection [{0}] died", actor);
            }
            else
            {
                _logger.Error("Remote connection [{0}] died", terminated.ActorRef);
            }

        }
Пример #14
0
 private void HandleTerminatedActor(Terminated termimated)
 {
     Console.WriteLine("Terminated: {0}", termimated.ActorRef.Path.Name);
 }
Пример #15
0
 private void HandleTerminated(Terminated message)
 {
     Console.WriteLine($"{message.ActorRef.Path.Address} terminated");
     Context.Stop(Self);
 }
Пример #16
0
 private void HandleTerminated(Terminated message)
 {
     WriteOutput($"Got termination of {message.ActorRef.Path.Address} message.");
     Self.Tell(new TryAgainLater("termination received"));
 }