Пример #1
0
        public DownloadManager(int concurrencyDegree, HttpClient?httpClient = null)
        {
            _httpClient          = httpClient ?? new HttpClient();
            _queuedTasks         = new ObservableCollection <TDownloadTask>();
            _taskQuerySet        = new HashSet <TDownloadTask>();
            _throttle            = new ReenterableAwaiter <bool>(true, true);
            _downloadTaskChannel = Channel.CreateUnbounded <TDownloadTask>();
            _semaphoreSlim       = new SemaphoreSlim(1, 1);
            ConcurrencyDegree    = concurrencyDegree;

            PollTask();
        }
Пример #2
0
 public DownloadStartingDeferral()
 {
     Signal = new ReenterableAwaiter <bool>(true, true);
 }