expirable-cache icon indicating copy to clipboard operation
expirable-cache copied to clipboard

ContainsOrAdd functions

Open Tehhs opened this issue 4 months ago • 0 comments

PR should hopefully address #17

Changes

  • Adds ContainsOrAdd(key, value) (contains, evicted) in an attempt to match hashicorps ContainsOrAdd function
  • Adds similar function ContainsOrSet(key, value, ttl) (contains) to V1 & V2 as they don't really have a concept of "Add" which returns a boolean if evicted like V3. Not sure about this part, let me know.
  • Unit tests

Testing

All unit tests pass in V1, V2 & V3.

Tehhs avatar Oct 11 '25 01:10 Tehhs