Esempio n. 1
0
        protected override async Task <RateLimitDescription> Execute(CancellationToken token)
        {
            ListParameter target;

            lock (_targetLists)
            {
                if (_targetLists.Count == 0)
                {
                    return(RateLimitDescription.Empty);
                }
                target        = _targetLists[_accessIndex++ % _targetLists.Count];
                _accessIndex %= _targetLists.Count;
            }
            try
            {
                var result = await _accessor.GetListTimelineAsync(target,
                                                                  null, null, _receiveCount, _includeRetweets, token)
                             .ConfigureAwait(false);

                result.CallForEachItems(_handler);
                return(result.RateLimit);
            }
            catch (Exception ex)
            {
                CallExceptionHandler(ex);
                throw;
            }
        }