You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a new class only for this functionality can be redundant, because AsyncCache and AsyncMemoizer are showing behaviour when error occurred. We can introduce a flag. What's your opinion on this?
Activity
lrhn commentedon Dec 8, 2023
It caches the actual result, which is reasonable.
Only caching successful futures is more of a "retry" behavior than a cache.
Meaning that a cache which doesn't cache errors is a reasonable thing, but a different feature than this async cache.
We could have both, or the current cache could have a flag.
akmalviya03 commentedon Dec 8, 2023
Creating a new class only for this functionality can be redundant, because
AsyncCacheandAsyncMemoizerare showing behaviour when error occurred. We can introduce a flag. What's your opinion on this?lrhn commentedon Dec 8, 2023
A flag is probably the simplest approach.
Extra work which only happens if an error occurs should not be a problem.
Still means that the default will still be the current behavior.
akmalviya03 commentedon Dec 8, 2023
Sure, adding a new flag with the name
canRetry. Or should we name this flag something else?akmalviya03 commentedon Dec 8, 2023
Added new variable
_canCacheExceptionit's making more sense overcanRetry