Inheritance: TimerWithElapsedCancellationAsync
 public ScoreMirrorSelector(int scoreLimit, IHostChecker hostChecker, IReadOnlyCollection<Uri> hostPool) {
     ThrowWhenHostPoolIsNullOrEmpty(hostPool);
     _scoreLimit = scoreLimit;
     _hostScores = hostChecker.SortAndValidateHosts(hostPool).ToDictionary(x => x, x => new HostState());
     _scoreMonitor = new TimerWithElapsedCancellationOnExceptionOnly(1*1000, IncreaseScoresWhenNeeded);
 }
Exemplo n.º 2
0
 internal StatusProcessor(IAbsoluteFilePath dest, ITProgress status, long predictedSize) {
     _dest = dest;
     _status = status;
     _predictedSize = predictedSize;
     _startTime = DateTime.UtcNow;
     _timer = new TimerWithElapsedCancellationOnExceptionOnly(TimeSpan.FromMilliseconds(250),
         CalculateProgressAndSpeed);
 }