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); }
internal StatusProcessor(IAbsoluteFilePath dest, ITProgress status, long predictedSize) { _dest = dest; _status = status; _predictedSize = predictedSize; _startTime = DateTime.UtcNow; _timer = new TimerWithElapsedCancellationOnExceptionOnly(TimeSpan.FromMilliseconds(250), CalculateProgressAndSpeed); }