Beispiel #1
0
 /// <summary>
 /// 触发任务结束事件。
 /// </summary>
 /// <param name="args">事件参数。。</param>
 protected void OnTerminate(TaskTerminateEventArgs args)
 {
     Terminated?.Invoke(this, args);
 }
Beispiel #2
0
 public Coordinator isReduceCoordinatorTerminated(Terminated message)
 {
     return(validReduceCoordinator.Find(coord => coord.CoordinatorActor.Equals(message.ActorRef)));
 }
Beispiel #3
0
 protected void FireTerminated()
 {
     Terminated?.Invoke(this, EventArgs.Empty);
 }
Beispiel #4
0
 private void HandleTerminateTransaction(Terminated obj)
 {
     _activeTransactions.Remove(obj.ActorRef);
 }
Beispiel #5
0
 public void Handle(Terminated message)
 {
     Console.Write("Server died");
 }
Beispiel #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);
 }
Beispiel #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();
 }
Beispiel #11
0
 /// <inheritdoc />
 public virtual void Terminate()
 {
     IsTerminated = true;
     Terminated?.Invoke(this, CurrentStatus);
 }
Beispiel #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));
        }
Beispiel #14
0
 private void ConnectionTerminatedCallback(HeliosConnectionException reason, IConnection closedchannel)
 {
     Terminated?.Invoke(reason, closedchannel);
 }
Beispiel #15
0
 private void ReceiveTerminated(Terminated terminated)
 {
 }
Beispiel #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)
 {
 }
Beispiel #18
0
 /// <summary>
 /// Debugger has disconnected.
 /// </summary>
 protected override void OnConnectionLost()
 {
     base.OnConnectionLost();
     Terminated.Fire(this);
 }
Beispiel #19
0
 public WrappedTerminated(Terminated terminated)
 {
     _terminated = terminated;
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #22
0
 public virtual void Terminate() => Terminated.Add(GetType());
Beispiel #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);
 }
Beispiel #24
0
 /// <summary>
 ///     Handles the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 public virtual void Handle(Terminated message)
 {
     this.HandleTerminated(message);
 }
Beispiel #25
0
 public bool isSSTerminated(Terminated message)
 {
     return(validSSWithSentReduceResults.Keys.Contains(message.ActorRef));
 }
 public WrappedTerminated(Terminated t)
 {
     T = t;
 }
Beispiel #27
0
 /// <summary>
 /// Invokes Terminated event
 /// </summary>
 public void Terminate()
 {
     Terminated?.Invoke(this, EventArgs.Empty);
 }
Beispiel #28
0
 public void Handle(Terminated message)
 {
     //remove terminated actor from hashlist
     _selfDBScheduledActor.Tell(new ClientDisconnectRequest(message.ActorRef));
 }
Beispiel #29
0
 protected virtual bool Terminate(Terminated message)
 {
     Logger.Warning($"{GetType().PrettyPrint()}: {message.ActorRef.Path} has terminated.");
     Context.Unwatch(message.ActorRef);
     return(true);
 }
Beispiel #30
0
 private void Process_Exited(object sender, EventArgs e)
 {
     Terminated?.Invoke(this, forcedKill);
 }