vlio20 / utils-decorators

Decorators for web and node applications
https://vlio20.github.io/utils-decorators/
MIT License
218 stars 13 forks source link

[WIP] Hot Cache implementation #151

Closed tripodsgames closed 1 year ago

tripodsgames commented 2 years ago

Hi @vlio20, i want to implement a hot cache functionality into the memoizeAsyncify, i want your opinion on this implementation. WORK IN PROGRESS.

Details: Hot cache system always keeps the cache available When the cache expires the function linked to it is called automatically, during this call the old cache is served until the new value is received. That way, only on the first call or in case of failures the memoizeAsyncify would have some delay

vlio20 commented 2 years ago

As I see it hot cache and a cache with TTL shouldn't work together. What do you think of creating a hot cache that can later be provided as an argument to the decorator?

vlio20 commented 2 years ago

I created a ticket for this issue, so let's have a discussion there.https://github.com/vlio20/utils-decorators/issues/153