コード例 #1
0
 protected static MultiMirrorFileDownloadSpec GetDlSpec(FileQueueSpec spec,
     KeyValuePair<FileFetchInfo, ITransferStatus> file,
     CancellationToken token) {
     var dlSpec = GetDlSpec(spec, file);
     dlSpec.CancellationToken = token;
     return dlSpec;
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public virtual async Task DownloadAsync(FileQueueSpec spec)
 {
     foreach (var file in spec.Files)
     {
         await
         Downloader.DownloadAsync(GetDlSpec(spec, file)).ConfigureAwait(false);
     }
 }
コード例 #4
0
        protected static MultiMirrorFileDownloadSpec GetDlSpec(FileQueueSpec spec,
                                                               KeyValuePair <FileFetchInfo, ITransferStatus> file,
                                                               CancellationToken token)
        {
            var dlSpec = GetDlSpec(spec, file);

            dlSpec.CancellationToken = token;
            return(dlSpec);
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
 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;
 }
コード例 #7
0
        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);
        }
コード例 #8
0
 public override Task DownloadAsync(FileQueueSpec spec, CancellationToken token)
     => spec.Files.StartConcurrentTaskQueue(token,
         file => Downloader.DownloadAsync(GetDlSpec(spec, file, token), token), _getMaxThreads);
コード例 #9
0
 public override Task DownloadAsync(FileQueueSpec spec) => spec.Files.StartConcurrentTaskQueue(
     file => Downloader.DownloadAsync(GetDlSpec(spec, file)), _getMaxThreads);
コード例 #10
0
 public virtual async Task DownloadAsync(FileQueueSpec spec) {
     foreach (var file in spec.Files) {
         await
             Downloader.DownloadAsync(GetDlSpec(spec, file)).ConfigureAwait(false);
     }
 }
コード例 #11
0
 public override Task DownloadAsync(FileQueueSpec spec, CancellationToken token)
 => spec.Files.StartConcurrentTaskQueue(token,
                                        file => Downloader.DownloadAsync(GetDlSpec(spec, file, token), token), _getMaxThreads);
コード例 #12
0
 public override Task DownloadAsync(FileQueueSpec spec) => spec.Files.StartConcurrentTaskQueue(
     file => Downloader.DownloadAsync(GetDlSpec(spec, file)), _getMaxThreads);