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);
     }
 }
예제 #2
0
 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);
         }
     }
 }