示例#1
0
        public async Task Stop(TimeSpan grace)
        {
            if (_task == null || _task.IsCompleted)
            {
                return;
            }

            _proc.Cancel();

            var finished = await Task.WhenAny(_task, _proc.Delay(grace, CancellationToken.None));

            if (finished != _task)
            {
                _proc.Debug("Shutdown timeout. ERASING FUTURE to KILL");
                _machine.Runtime.FutureQueue.Erase(_scheduler);
            }

            ReleaseResources();
        }
示例#2
0
 public void Debug(string message)
 {
     _proc.Debug(message);
 }