public void Enqueue(Document doc) { Check.ValidateDocument(doc); lock(((ICollection)queue).SyncRoot) { bool exist = false; foreach (var d in this.queue) { if (d.Url.Equals(doc.Url, StringComparison.InvariantCultureIgnoreCase)) { exist = true; break; } } if (!exist) { Measurement.DocumentsPendingCounter.Increment(); Measurement.DocumentsTotalCounter.Increment(); queue.Enqueue(doc); } } }
public static void ValidateDocument(Document doc) { }
public void Put(Document doc) { Check.ValidateDocument(doc); string key = Utility.LowerString(doc.Url); this.dictionary[key] = doc; }