Example #1
0
 public Unit AddSubscription(ProcessId pid, IDisposable sub)
 {
     RemoveSubscription(pid);
     subs = subs.Add(pid.Path, sub);
     return(unit);
 }
Example #2
0
 /// <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);
Example #3
0
 public void Add(string key, string value) =>
 state = state.Add(key, (value, DateTime.UtcNow));