expirable-cache
expirable-cache copied to clipboard
ContainsOrAdd functions
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.