golang / golang/groupcache

Support whether the returned value was cached or not

Open
#61 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
13.3k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

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:

``` go
// 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.