mcollina / async-cache-dedupe

Async cache with dedupe support
MIT License
640 stars 40 forks source link

feat: add onError listener #13

Closed zbo14 closed 2 years ago

zbo14 commented 2 years ago

Partially addresses #12

@simone-sanfratello What would a "stale-if-error" approach look like? Redis expires according to the ttl, no? and StorageMemory.get() clears stale records before a Wrapper.func() call could potentially throw.

simone-sanfratello commented 2 years ago

I haven't described "stale on error" properly, sorry for that, btw this is fine for "onError" I'm opening another issue for "stale on error"