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

feat: Add RemoveWithoutEvict cache method #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bodgit
Copy link

@bodgit bodgit commented Apr 2, 2024

This PR adds the ability to remove elements from a cache without calling any configured eviction callback.

My use-case is I have a cache of non-trivial io.ReadCloser implementations and the eviction callback calls Close() on any "expired" entries. I want to be able to retrieve a cache entry and remove it from the cache to prevent another goroutine using it, however currently doing this calls Close() which then renders the io.ReadCloser unusable.

Fixes #171

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.

Request for RemoveWithoutEvict API.
1 participant