ksysoev / wasabi

Toolkit for Creating WebSocket API Gateways
MIT License
5 stars 2 forks source link

Replace naive implementation of circuit breaker with using proper library #77

Closed ksysoev closed 3 months ago

ksysoev commented 3 months ago

Current implementation of circuit breaker midleware is quite naive and not implementing pattern properly, it would be nice to replace it with properly implemented library.

this could be a good candidate for the replacement: https://github.com/sony/gobreaker

KianYang-Lee commented 3 months ago

Nice I like this can I take this?

KianYang-Lee commented 3 months ago

the existing param recoverAfter for NewCircuitBreakerMiddleware is not able to integrate with this gobreaker library. We can only control how the CB turns semi-open with duration, not number of successful requests. Anyhow when the CB is open it will not allow requests anyway, so there is no way to hit the condition?

ksysoev commented 3 months ago

@KianYang-Lee sure feel free to drop recoverAfter argument