public Unit AddSubscription(ProcessId pid, IDisposable sub) { RemoveSubscription(pid); subs = subs.Add(pid.Path, sub); return(unit); }
/// <summary> /// Atomically adds a new item to the map /// </summary> /// <remarks>Null is not allowed for a Key or a Value</remarks> /// <param name="key">Key</param> /// <param name="value">Value</param> /// <exception cref="ArgumentException">Throws ArgumentException if the key already exists</exception> /// <exception cref="ArgumentNullException">Throws ArgumentNullException the key or value are null</exception> /// <returns>New Map with the item added</returns> public static Map <K, V> add <K, V>(Map <K, V> map, K key, V value) => map.Add(key, value);
public void Add(string key, string value) => state = state.Add(key, (value, DateTime.UtcNow));