Beispiel #1
0
 private void HandleWatch(Watch w)
 {
     if (_state >= ContextState.Stopping)
     {
         w.Watcher.SendSystemMessage(Terminated.From(Self));
     }
     else
     {
         EnsureExtras().Watch(w.Watcher);
     }
 }
Beispiel #2
0
        //Last and final termination step
        private async Task FinalizeStopAsync()
        {
            ProcessRegistry.Instance.Remove(Self);
            //This is intentional
            await InvokeUserMessageAsync(Stopped.Instance);

            DisposeActorIfDisposable();

            //Notify watchers
            _extras?.Watchers.SendSystemNessage(Terminated.From(Self));

            //Notify parent
            Parent?.SendSystemMessage(Terminated.From(Self));

            _state = ContextState.Stopped;
        }