Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for RemoveWithoutEvict API. #171

Open
StLeoX opened this issue Feb 4, 2024 · 0 comments · May be fixed by #176
Open

Request for RemoveWithoutEvict API. #171

StLeoX opened this issue Feb 4, 2024 · 0 comments · May be fixed by #176

Comments

@StLeoX
Copy link

StLeoX commented Feb 4, 2024

lru always calls onEvict once when Remove is called. In a case where the element that I want to remove is already processed, and the processing logic is different from onEvict, I want to simply remove the element RemoveWithoutEvict API, it may be written as follow:

 func (c *Cache[K, V]) RemoveWithoutEvict(key K) (present bool) {
     c.lock.Lock()
     present = c.lru.Remove(key)
     c.lock.Unlock()
     return
 }
@bodgit bodgit linked a pull request Apr 2, 2024 that will close this issue
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 a pull request may close this issue.

1 participant