protected static MultiMirrorFileDownloadSpec GetDlSpec(FileQueueSpec spec, KeyValuePair<FileFetchInfo, ITransferStatus> file, CancellationToken token) { var dlSpec = GetDlSpec(spec, file); dlSpec.CancellationToken = token; return dlSpec; }
public virtual async Task DownloadAsync(FileQueueSpec spec, CancellationToken token) { foreach (var file in spec.Files) { token.ThrowIfCancellationRequested(); await Downloader.DownloadAsync(GetDlSpec(spec, file, token), token).ConfigureAwait(false); } }
public virtual async Task DownloadAsync(FileQueueSpec spec) { foreach (var file in spec.Files) { await Downloader.DownloadAsync(GetDlSpec(spec, file)).ConfigureAwait(false); } }
protected static MultiMirrorFileDownloadSpec GetDlSpec(FileQueueSpec spec, KeyValuePair <FileFetchInfo, ITransferStatus> file, CancellationToken token) { var dlSpec = GetDlSpec(spec, file); dlSpec.CancellationToken = token; return(dlSpec); }
protected static MultiMirrorFileDownloadSpec GetDlSpec(FileQueueSpec spec, KeyValuePair<FileFetchInfo, ITransferStatus> file) { var dlSpec = new MultiMirrorFileDownloadSpec(file.Key.FilePath, spec.Location.GetChildFileWithName(file.Key.FilePath)) { Progress = file.Value, Verification = file.Key.OnVerify, ExistingFile = file.Key.ExistingPath != null ? spec.Location.GetChildFileWithName(file.Key.ExistingPath) : null }; dlSpec.LocalFile.MakeSureParentPathExists(); return dlSpec; }
protected static MultiMirrorFileDownloadSpec GetDlSpec(FileQueueSpec spec, KeyValuePair <FileFetchInfo, ITransferStatus> file) { var dlSpec = new MultiMirrorFileDownloadSpec(file.Key.FilePath, spec.Location.GetChildFileWithName(file.Key.FilePath)) { Progress = file.Value, Verification = file.Key.OnVerify, ExistingFile = file.Key.ExistingPath != null?spec.Location.GetChildFileWithName(file.Key.ExistingPath) : null }; dlSpec.LocalFile.MakeSureParentPathExists(); return(dlSpec); }
public override Task DownloadAsync(FileQueueSpec spec, CancellationToken token) => spec.Files.StartConcurrentTaskQueue(token, file => Downloader.DownloadAsync(GetDlSpec(spec, file, token), token), _getMaxThreads);
public override Task DownloadAsync(FileQueueSpec spec) => spec.Files.StartConcurrentTaskQueue( file => Downloader.DownloadAsync(GetDlSpec(spec, file)), _getMaxThreads);