You may be interested in Groupcache's method for filling caches, it solves the same problem that I believe this project is aimed at.
Groupcache has a similar goal of limiting the number of fetches required to fill a cache key to one—regardless of the number of concurrent requests for that key—but it doesn't try to speculatively fetch data, it just coordinates fetching so that all the routines attempting to query the same key make one fetch between them and share the same result.
https://github.com/golang/groupcache?tab=readme-ov-file#load...
Is groupcache suitable for current use? I don't see commits in years and the issues have reports of panics due to bugs.
hey thank you for sharing this. Based on what I understand, this package focuses on the underlying storage mechanism itself rather than helping with the cache strategy. It seems like a solid storage extension which can be used Pocache!
It's using singleflight which was later on added to the Go std lib:
https://github.com/golang/groupcache/tree/master/singlefligh...
https://pkg.go.dev/golang.org/x/sync/singleflight