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

Move global state to explicit var to allow deallocation? #66

Open
udhos opened this issue Dec 28, 2023 · 0 comments
Open

Move global state to explicit var to allow deallocation? #66

udhos opened this issue Dec 28, 2023 · 0 comments

Comments

@udhos
Copy link
Contributor

udhos commented Dec 28, 2023

Hi,

I have a use case for, while not restarting the application, bringing down groupcache allocated resources (let the GC release them), then recreate those resources with new configurations.

I see the global state is the obvious roadblock for that scenario.

So I started to sketch a change to allow recreation of groupcache resources. I am keeping existing APIs unchanged and adding some alternative APIs with support for an extra argument for explicit state ("workspace") provided by the caller. Hence the caller would be able to drop references to workspace in order to allow the garbage collector to get rid of its resources.

Draft PR: #65

What do you think? Would this be generally useful for a wider audience?

Cheers,
Everton

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

No branches or pull requests

1 participant