-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Title: Implement Distributed Circuit Breaker #70
Title: Implement Distributed Circuit Breaker #70
Conversation
Thank you for your PR. The latest implementation is under |
@YoshiyukiMineo I have move the implementation under v2. Could you please review it? |
Hi reviewers, I've addressed the previous feedback. Would appreciate another look when you have a chance. Thanks! |
Thanks. I have merged your PR into |
Distributed Circuit Breaker Implementation
Overview
This implementation introduces a distributed version of our circuit breaker pattern. The new
DistributedCircuitBreaker
extends the existingCircuitBreaker
functionality by supporting any storage backend through a genericCacheClient
interface, enabling distributed state management across multiple instances of an application.Key Changes
DistributedCircuitBreaker[T]
struct that embeds the originalCircuitBreaker[T]
CacheClient
interface that can be implemented by any storage solution (Redis, Memcached, etcd, etc.)StorageSettings
to configure the distributed circuit breakerStoredState
struct to represent the circuit breaker state in the storage backendFeatures
Storage Flexibility
CacheClient
interfaceDesign Considerations
GetState
andSetState
methodsT
maintains type safety for the protected operation's resultNext Steps
This enhancement makes our circuit breaker implementation more flexible and adaptable to different distributed storage requirements while maintaining its core functionality and reliability.