Skip to content
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

define two CircuitBreaker problem #88

Open
Mahdi-Ba opened this issue Jan 8, 2024 · 1 comment
Open

define two CircuitBreaker problem #88

Mahdi-Ba opened this issue Jan 8, 2024 · 1 comment

Comments

@Mahdi-Ba
Copy link
Contributor

Mahdi-Ba commented Jan 8, 2024

I define two CircuitBreaker But if one of them changes the state of all CircuitBreaker change!!!
I think , need to change the code when set in Redis and use the name of CircuitBreaker to solve it

breaker = pybreaker.CircuitBreaker(name='breaker', fail_max=3, reset_timeout=2, listeners=[NotifyListener()],
                                   state_storage=pybreaker.CircuitRedisStorage(pybreaker.STATE_CLOSED, redis))

other_breaker = pybreaker.CircuitBreaker(name='other_breaker', fail_max=3, reset_timeout=2, listeners=[NotifyListener()],
                                   state_storage=pybreaker.CircuitRedisStorage(pybreaker.STATE_CLOSED, redis))
@danielfm
Copy link
Owner

danielfm commented Jan 8, 2024

I think you need to specify different namespace names for each Redis storage.

namespace: str | None = None,

Maybe the docs should have been more clear about this. If you wish to contribute some improvements in that area, I'd be more than glad to accept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants