void CreateRateLimiters() { RateLimiter downloader = new RateLimiter(); _downloadLimiter = new RateLimiterGroup(); _downloadLimiter.Add(new PauseLimiter(this)); _downloadLimiter.Add(downloader); RateLimiter uploader = new RateLimiter(); _uploadLimiter = new RateLimiterGroup(); _uploadLimiter.Add(new PauseLimiter(this)); _uploadLimiter.Add(uploader); }
private void CreateRateLimiters() { var downloader = new RateLimiter(); downloadLimiter = new RateLimiterGroup(); downloadLimiter.Add(new DiskWriterLimiter(DiskManager)); downloadLimiter.Add(downloader); var uploader = new RateLimiter(); uploadLimiter = new RateLimiterGroup(); downloadLimiter.Add(new DiskWriterLimiter(DiskManager)); uploadLimiter.Add(uploader); MainLoop.QueueTimeout(TimeSpan.FromSeconds(1), () => { downloader.UpdateChunks( Settings.GlobalMaxDownloadSpeed, TotalDownloadSpeed); uploader.UpdateChunks(Settings.GlobalMaxUploadSpeed, TotalUploadSpeed); return(!disposed); }); }
private void CreateRateLimiters() { var downloader = new RateLimiter(); downloadLimiter = new RateLimiterGroup(); downloadLimiter.Add(new DiskWriterLimiter(DiskManager)); downloadLimiter.Add(downloader); var uploader = new RateLimiter(); uploadLimiter = new RateLimiterGroup(); downloadLimiter.Add(new DiskWriterLimiter(DiskManager)); uploadLimiter.Add(uploader); MainLoop.QueueTimeout(TimeSpan.FromSeconds(1), () => { downloader.UpdateChunks( Settings.GlobalMaxDownloadSpeed, TotalDownloadSpeed); uploader.UpdateChunks(Settings.GlobalMaxUploadSpeed, TotalUploadSpeed); return !disposed; }); }