public string GetUrl(string spisovaZnacka) { if (CachedUrls.TryGetValue(spisovaZnacka, out var url)) { GlobalStats.LinkCacheCount++; return(url); } else { var value = UnderlyingClient.GetUrl(spisovaZnacka); CachedUrls.TryAdd(spisovaZnacka, url); return(value); } }
private void LinkProcessor() { while (!LinkRequestsQueue.IsEmpty || WsProcessorTask.Status == TaskStatus.Running || MessageProcessorTask.Status == TaskStatus.Running) { LinkRequestsQueue.TryDequeue(out var item); if (item != null) { item.Url = IsirClient.GetUrl(item.SpisovaZnacka); } else { Thread.Sleep(100); } } }