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

Exposed interface Sink not usable #89

Open
gouthamve opened this issue Sep 25, 2017 · 1 comment
Open

Exposed interface Sink not usable #89

gouthamve opened this issue Sep 25, 2017 · 1 comment

Comments

@gouthamve
Copy link

I am currently trying to implement a custom sink but the definition has an unexported method which makes it impossible to implement a custom Sink. Is this intended, if not, will you accept a PR changing it?

My use-case for a custom Sink, currently I am caching 4MB chunks and would like to only read 500 bytes at a time at different offsets. But for each call, groupcache allocates full 4MB when calling cloneBytes(), I would like to allocate right amount to reduce allocs.

cc @bradfitz

@bradfitz
Copy link
Contributor

bradfitz commented Nov 2, 2017

It's intentional that it has a private method, so we can make assumptions safely in the code about the set of possible concrete type conversions.

Rather than supporting custom sinks, I'd rather address any deficiencies in the provided ones.

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

2 participants