dgraph-io / ristretto

A high performance memory-bound Go cache
https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache/
Apache License 2.0
5.54k stars 364 forks source link

feat: load value if not present #355

Closed proost closed 1 month ago

proost commented 1 year ago

Resolve: https://github.com/dgraph-io/ristretto/issues/332

Get value if cache hit, or load value, set to cache and return loaded value.

only one go-routine can execute load function per key.

proost commented 1 year ago

@joshua-goldstein @mangalaman93 @harshil-goel @all-seeing-code can you give me any feedback? If this feature is unnecessary, I will close the PR.

github-actions[bot] commented 2 months ago

This PR has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.