3 ms·
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 g
by bww 2y ago
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#loading-process https://github.com/golang/groupcache?tab=readme-ov-file#load...
- Thaxll 2y agoIt's using singleflight which was later on added to the Go std lib: https://github.com/golang/groupcache/tree/master/singleflight https://github.com/golang/groupcache/tree/master/singlefligh... https://pkg.go.dev/golang.org/x/sync/singleflight https://pkg.go.dev/golang.org/x/sync/singleflight
- ecnahc515 2y agoJust a note that `x/sync` is not part of the Go std lib.
- iudqnolq 2y agoIs groupcache suitable for current use? I don't see commits in years and the issues have reports of panics due to bugs.
- stock_toaster 2y agoIndeed. It also looks like there is a maintained fork[1], but no clue with regards to the quality. [1]: https://github.com/golang/groupcache/issues/158#issuecomment-2120682922 https://github.com/golang/groupcache/issues/158#issuecomment...
- derekperkins 2y agoAnother maintained fork https://github.com/mailgun/groupcache https://github.com/mailgun/groupcache
- bnkamalesh 2y agohey 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!