Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Nov 13, 2023

Provide functional parity with ConcurrentDictionary for IAsyncCache.TryRemove, following the implementation for ICache in #394.

  • AsyncAtomicFactory implements IEquatable to compare wrapped values. Values that are not yet created are always not equal, similar to comparing null.
  • Provide bool TryRemove(K key, out V value) and bool TryRemove(KeyValuePair<K,V> item) for IAsyncCache and AtomicFactoryAsyncCache.
  • IAsyncCache default implementations for backwards compatibility throw NotSupportedException. There is no way to correctly implement either new method, so it is better to throw than give the caller an incorrect result. This would only apply if a caller implements IAsyncCache themselves, upgrades the library, and doesn't have impls for these methods.

@coveralls
Copy link

coveralls commented Nov 13, 2023

Coverage Status

coverage: 98.678% (+0.07%) from 98.605%
when pulling 0cb52af on users/alexpeck/asynctryrem
into fe1a27a on main.

@bitfaster bitfaster marked this pull request as ready for review November 13, 2023 07:52
@bitfaster bitfaster merged commit b4a5a03 into main Nov 13, 2023
@bitfaster bitfaster deleted the users/alexpeck/asynctryrem branch November 13, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants