groupcache icon indicating copy to clipboard operation
groupcache copied to clipboard

Support whether the returned value was cached or not

Open gabriel opened this issue 8 years ago • 2 comments

There is no way to know if a returned value was the result of the call or a cached result? This is useful to know in certain circumstances.

Something like:

// SomeMethod ... and also returns whether the value was cached result or not
func (g *Group) SomeMethod(key string, fn func() (interface{}, error)) (interface{}, bool, error) {

In the case of cached lookup the returned bool is true.

gabriel avatar Jan 20 '16 19:01 gabriel

@gabriel @bradfitz Hi, Is there anyone working on this enhancement. I am really interested contributing to this project. I thought I could contribute to this requirement. Can we chat about this? Is there any chat group for this project?

dineshappavoo avatar Apr 15 '16 08:04 dineshappavoo

There is no chat group for this project, and it's largely frozen. People use this and it works, but nobody is particularly interested in adding features (which has a cost in terms of maintenance and updating code)

If it's not very invasive, we could consider it, though.

bradfitz avatar Jun 29 '16 23:06 bradfitz