eko / gocache

☔️ A complete Go cache library that brings you multiple ways of managing your caches

Home Page:https://vincent.composieux.fr/article/i-wrote-gocache-a-complete-and-extensible-go-cache-library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to set an option during NewLoadable or Get to ensure that when there is no value, it directly performs a synchronous set instead of an asynchronous set?

MrHuangjiacong opened this issue · comments

I have a scenario where I make requests to other APIs, and I need to ensure that a particular API is only executed once and its result is saved, especially in high-concurrency situations. Therefore, I require a real-time set operation.

Hi,

This issue has been solved by using the singleflight Go tool here: #243

Closing this issue for now but feel free to reopen if any issue remains.

Thank you