-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
The hashicorp lru.Cache implementation (https://github.com/hashicorp/golang-lru/blob/main/lru.go) contains a few other functions which are useful. I'm not sure why they don't include them in the simplelru or expirablelru implementations. In particular, the ContainsOrAdd function which checks for an item and either adds it or returns that it was found without updating recently used information. This is helpful in the case where multiple go routines are using the cache and may have duplicate data. Without such a function, a lock is required around the cache Get + Add operation.
Any plans to add something like this capability or a reason why it doesn't fit with the current implementation?
Metadata
Metadata
Assignees
Labels
No labels