示例#1
0
 /// <summary>
 /// 触发任务结束事件。
 /// </summary>
 /// <param name="args">事件参数。。</param>
 protected void OnTerminate(TaskTerminateEventArgs args)
 {
     Terminated?.Invoke(this, args);
 }
示例#2
0
 public Coordinator isReduceCoordinatorTerminated(Terminated message)
 {
     return(validReduceCoordinator.Find(coord => coord.CoordinatorActor.Equals(message.ActorRef)));
 }
示例#3
0
 protected void FireTerminated()
 {
     Terminated?.Invoke(this, EventArgs.Empty);
 }
示例#4
0
 private void HandleTerminateTransaction(Terminated obj)
 {
     _activeTransactions.Remove(obj.ActorRef);
 }
示例#5
0
 public void Handle(Terminated message)
 {
     Console.Write("Server died");
 }
示例#6
0
 protected virtual bool Terminate(Terminated message)
 {
     Logger.Warning("Aggregate of Type={0}, and Id={1}; has terminated.", typeof(TAggregate).PrettyPrint(), message.ActorRef.Path.Name);
     Context.Unwatch(message.ActorRef);
     return(true);
 }
 private void Window_Closing()
 {
     logger.Info($"Instance has terminated.");
     control.Destroy();
     Terminated?.Invoke(Id);
 }
示例#8
0
        public Task ConnectedAsync(IContext context)
        {
            switch (context.Message)
            {
            case RemoteTerminate msg:
            {
                if (_watched.TryGetValue(msg.Watcher.Id, out var pidSet))
                {
                    pidSet.Remove(msg.Watchee);
                    if (pidSet.Count == 0)
                    {
                        _watched[msg.Watcher.Id] = null;
                    }
                }

                //create a terminated event for the Watched actor
                var t = new Terminated
                {
                    Who = msg.Watchee
                };
                //send the address Terminated event to the Watcher
                msg.Watcher.SendSystemMessage(t);
                break;
            }

            case EndpointTerminatedEvent _:
            {
                _logger.LogDebug($"Handle terminated address {_address}");

                foreach (var(id, pidSet) in _watched)
                {
                    var watcherPid = new PID(ProcessRegistry.Instance.Address, id);
                    var watcherRef = ProcessRegistry.Instance.Get(watcherPid);
                    if (watcherRef != DeadLetterProcess.Instance)
                    {
                        foreach (var pid in pidSet)
                        {
                            //create a terminated event for the Watched actor
                            var t = new Terminated
                            {
                                Who = pid,
                                AddressTerminated = true
                            };

                            //send the address Terminated event to the Watcher
                            watcherPid.SendSystemMessage(t);
                        }
                    }
                }

                _watched.Clear();
                _behavior.Become(TerminatedAsync);
                break;
            }

            case RemoteUnwatch msg:
            {
                if (_watched.TryGetValue(msg.Watcher.Id, out var pidSet))
                {
                    pidSet.Remove(msg.Watchee);
                    if (pidSet.Count == 0)
                    {
                        _watched[msg.Watcher.Id] = null;
                    }
                }

                var w = new Unwatch(msg.Watcher);
                Remote.SendMessage(msg.Watchee, w, -1);
                break;
            }

            case RemoteWatch msg:
            {
                if (_watched.TryGetValue(msg.Watcher.Id, out var pidSet))
                {
                    pidSet.Add(msg.Watchee);
                }
                else
                {
                    _watched[msg.Watcher.Id] = new FastSet <PID> {
                        msg.Watchee
                    };
                }

                var w = new Watch(msg.Watcher);
                Remote.SendMessage(msg.Watchee, w, -1);
                break;
            }

            case Stopped _:
            {
                _logger.LogDebug("Stopped EndpointWatcher");
                break;
            }
            }
            return(Actor.Done);
        }
 public void ConnectionTerminated(ClusterInbounConnection connection)
 {
     Terminated?.Invoke(this, new ClusterConnectionEventArgs(connection));
 }
 public void Terminate()
 {
     Terminated?.Invoke(this);
     End();
 }
示例#11
0
 /// <inheritdoc />
 public virtual void Terminate()
 {
     IsTerminated = true;
     Terminated?.Invoke(this, CurrentStatus);
 }
示例#12
0
 private void Process_Terminated(int exitCode)
 {
     logger.Info($"Application instance has terminated with exit code {exitCode}.");
     FinalizeEvents();
     Terminated?.Invoke(Id);
 }
        private void Handle(Terminated m)
        {
            // This function should be used under test environment only.

            Handle(new ClusterActorDiscoveryMessage.ActorDown(m.ActorRef, null));
        }
示例#14
0
 private void ConnectionTerminatedCallback(HeliosConnectionException reason, IConnection closedchannel)
 {
     Terminated?.Invoke(reason, closedchannel);
 }
示例#15
0
 private void ReceiveTerminated(Terminated terminated)
 {
 }
示例#16
0
 /// <summary>
 /// Terminates the session.
 /// </summary>
 private void HandleTerminate()
 {
     Terminated?.Invoke(this, EventArgs.Empty);
 }
 /// <summary>
 ///     Handles a Terminated message.
 /// </summary>
 /// <param name="message">The message.</param>
 public virtual void HandleTerminationMessage(Terminated message)
 {
 }
示例#18
0
 /// <summary>
 /// Debugger has disconnected.
 /// </summary>
 protected override void OnConnectionLost()
 {
     base.OnConnectionLost();
     Terminated.Fire(this);
 }
示例#19
0
 public WrappedTerminated(Terminated terminated)
 {
     _terminated = terminated;
 }
示例#20
0
 protected virtual Boolean Terminate(Terminated message)
 {
     Logger.Warning("DomainService of Type={0}, and Id={1}; has terminated.", typeof(TDomainService).PrettyPrint(), message.ActorRef.Path.Name);
     Context.Unwatch(message.ActorRef);
     return(true);
 }
示例#21
0
 /// <summary>
 /// Overrides this method if want to handle behavior when the application is terminated.
 /// If base.OnTerminate() is not called, the event 'Terminated' will not be emitted.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 protected virtual void OnTerminate()
 {
     Terminated?.Invoke(this, EventArgs.Empty);
 }
示例#22
0
 public virtual void Terminate() => Terminated.Add(GetType());
示例#23
0
 private void HandleTerminated(Terminated msg)
 {
     Console.WriteLine($"Received Terminated message for {msg.Who.Address}: {msg.Who.Id}. Address terminated? {msg.AddressTerminated}");
     _terminatedMessages.Add(msg);
 }
示例#24
0
 /// <summary>
 ///     Handles the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 public virtual void Handle(Terminated message)
 {
     this.HandleTerminated(message);
 }
示例#25
0
 public bool isSSTerminated(Terminated message)
 {
     return(validSSWithSentReduceResults.Keys.Contains(message.ActorRef));
 }
示例#26
0
 public WrappedTerminated(Terminated t)
 {
     T = t;
 }
示例#27
0
 /// <summary>
 /// Invokes Terminated event
 /// </summary>
 public void Terminate()
 {
     Terminated?.Invoke(this, EventArgs.Empty);
 }
示例#28
0
 public void Handle(Terminated message)
 {
     //remove terminated actor from hashlist
     _selfDBScheduledActor.Tell(new ClientDisconnectRequest(message.ActorRef));
 }
示例#29
0
 protected virtual bool Terminate(Terminated message)
 {
     Logger.Warning($"{GetType().PrettyPrint()}: {message.ActorRef.Path} has terminated.");
     Context.Unwatch(message.ActorRef);
     return(true);
 }
示例#30
0
 private void Process_Exited(object sender, EventArgs e)
 {
     Terminated?.Invoke(this, forcedKill);
 }