private async Task Process(IReadOnlyCollection <FileInfoWithData <State> > files, IAbsoluteDirectoryPath downloadPath, IReadOnlyCollection <Uri> mirrors, CancellationToken cancellationToken, int concurrentDownloads) { using (var processor = new SynqProcessor(concurrentDownloads, cancellationToken)) using (var selector = SyncEvilGlobal.DownloadHelper.StartMirrorSession(mirrors)) await new Handler(processor, selector.Value).DoIt(files).ConfigureAwait(false); if (downloadPath.Exists) { downloadPath.DirectoryInfo.Delete(true); } }
public Handler(SynqProcessor processor, IMirrorSelector selector) { _processor = processor; _selector = selector; }