connor4312 / cockatiel

🐦 A resilience and fault-handling library. Supports Backoffs, Retries, Circuit Breakers, Timeouts, Bulkhead Isolation, and Fallbacks.
MIT License
1.59k stars 50 forks source link

please consider changing CircuitState to contain strings instead of numbers #55

Closed xenoterracide closed 2 years ago

xenoterracide commented 2 years ago

this is unreadable without looking at the code

    this.breakerPolicy.onStateChange(data => this.log.trace('breaker', data))

So I'll have to map it myself, but it would be nice if v3 would change this since in theory it can break backwards compatibility.

xenoterracide commented 2 years ago

nevermind , this does what I want

    this.breakerPolicy.onStateChange(data => this.log.trace('breaker', CircuitState[data]))