private bool ResultCache_CheckUri(object sender, string uri) { _succeededUris.Update(); _failedUris.Update(); if (_succeededUris.Contains(uri)) { return(true); } if (_failedUris.Contains(uri)) { return(false); } if (this.CheckUri(uri)) { _succeededUris.Add(uri); return(true); } else { _failedUris.Add(uri); return(false); } }
public IEnumerable <MulticastClue> GetMulticastClues(Channel channel, string type) { lock (_lockObject) { _aliveChannels.Add(channel); _multicastTypes[type] = DateTime.UtcNow; var list = new List <MulticastClue>(); if (_MulticastClues.TryGetValue(type, out var dic)) { if (dic.TryGetValue(channel, out var dic2)) { list.AddRange(dic2.Values.SelectMany(n => n)); } } return(list); } }
public IEnumerable <MulticastMetadata> GetMulticastMetadatas(Tag tag, string type) { using (_lockManager.ReadLock()) { _aliveTags.Add(tag); _multicastTypes[type] = DateTime.UtcNow; var list = new List <MulticastMetadata>(); if (_multicastMetadatas.TryGetValue(type, out var dic)) { if (dic.TryGetValue(tag, out var dic2)) { list.AddRange(dic2.Values.Extract()); } } return(list); } }