nodeshift / opossum

Node.js circuit breaker - fails fast ⚡️
https://nodeshift.dev/opossum/
Apache License 2.0
1.33k stars 107 forks source link

feature: Coalesce reset options, reset coalesce based on result. (error, success, timeout) #908

Closed daan944 closed 6 days ago

daan944 commented 1 week ago

After implementing coalescing in our software, we noticed it would be handy to better finetune coalescion behavior.

So added the option to reset coalescion cache at different stages: error, success, timeout. This can be used as sometimes you'd like to retry after an error/timeout, or would like to limit cache TTL without limiting coalescion TTL (e.g. a slow action to fetch data you do want to execute as often as possible but never twice at the same time).

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 12007398503

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/circuit.js 9 10 90.0%
<!-- Total: 10 11 90.91% -->
Totals Coverage Status
Change from base Build 11779273678: -0.2%
Covered Lines: 411
Relevant Lines: 413

💛 - Coveralls
lholmquist commented 1 week ago

could you also update the readme with this new functionally

daan944 commented 1 week ago

Done!

lholmquist commented 6 days ago

released as 8.4.0 on npm