circuitbreaker
circuitbreaker copied to clipboard
Store history of last N errors and api to get last error or all history
We want to use circuit breaker instance in our healthcheck reporting. Would be nice if cb instance was able to report which errors triggered it to fail. If that's something you consider useful for this library we can send a PR.
That sounds cool, I'd definitely take a PR for it. 👍
so we envision a couple of additional api methods, it will stay compatible: FailWithError(error) Error() error - return last error Errors() []error - return history of errors
I'm not sure yet how we configure history depth. Do you have any suggestions?
@rubyist I've submitted PR, let me know what you think. Thanks!