/// <summary> /// Add a location to HashRing /// </summary> /// <param name="item">the item to add</param> public HashRingLocation <T> AddLocation(T item) { item.ThrowIfNull(); UInt32 key = Hashing.HashItem(item); HashRingLocation <T> location = new HashRingLocation <T>(key, item); location.ReceivedItem += Location_ReceivedItem; LocationDictionary.Add(key, location); return(location); }
/// <summary> /// Add a HashRingLocation to the HashRing /// </summary> /// <param name="location">the HashRingLocation</param> public void AddLocation(IHashRingLocation <T> location) { location.ReceivedItem += Location_ReceivedItem; LocationDictionary.Add(location.Key, location); }