Пример #1
0
        private async Task <SystemDetails> GetSystemDetails(SystemRef sys, ProgressNotifier notifier)
        {
            await _throttler.WaitAsync();

            try
            {
                return(await _client.GetDetails(sys));
            }
            finally
            {
                notifier.NotifyIncrease();
                _throttler.Release();
            }
        }
Пример #2
0
        private async Task <SystemDetails[]> GetSystemsDetails(SystemRef[] systems)
        {
            Console.WriteLine("Getting systems details...");
            var notifier = new ProgressNotifier($"  Scanned systems: {{0}}/{systems.Length}");

            try
            {
                return(await Task.WhenAll(systems.Select(r => GetSystemDetails(r, notifier))));
            }
            finally
            {
                notifier.Finish();
            }
        }