Skip to content

v2.3.0

Compare
Choose a tag to compare
@bitfaster bitfaster released this 06 Oct 01:22
· 196 commits to main since this release
4330c16

What's changed

  • Align TryRemove overloads with ConcurrentDictionary for ICache (including WithAtomicGetOrAdd). This adds two new overloads:
    • bool TryRemove(K key, out V value) - enables getting the value that was removed.
    • bool TryRemove(KeyValuePair<K, V> item) - enables removing an item only when the key and value are the same.
  • Fix ConcurrentLfu.Clear() to remove all values when using BackgroundThreadScheduler. Previously values may be left behind after clear was called due to removed items present in window/protected/probation polluting the list of candidates to remove.
  • Fix ConcurrentLru.Clear() to reset the isWarm flag. Now cache warmup behaves the same for a new instance of ConcurrentLru vs an existing instance that was full then cleared. Previously ConcurrentLru could have reduced capacity during warmup after calling clear, depending on the access pattern.
  • Add extension methods to make it more convenient to use AtomicFactory with a plain ConcurrentDictionary. This is similar to storing a Lazy<T> instead of T, but with the same exception propagation semantics and API as ConcurrentDictionary.GetOrAdd.

Full changelog: v2.2.1...v2.3.0