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

Circuit breakers uniquely identified by name #44

Open
upsicleclown opened this issue Mar 25, 2022 · 1 comment
Open

Circuit breakers uniquely identified by name #44

upsicleclown opened this issue Mar 25, 2022 · 1 comment

Comments

@upsicleclown
Copy link

I've got a problem where I would like to apply the same circuit breaker to different instances of the same function (a function that cannot be created as a static method to solve this problem). As it stands, a new circuit breaker is created for each instance of this function.

It would be useful to cover this case and others by making the circuit breakers uniquely identified by name and thus able to be reused in the situation as above. Since all the circuit breakers are kept track of in CircuitBreakerMonitor, a solution could just include checking if a circuit breaker by that name already exists and, if it does, returning the existing circuit breaker.

@alfaex
Copy link

alfaex commented Mar 30, 2022

Hi.
First, very cool lib, thanks.

I would like something similar too.

I want to have different methods and classes under the same name, so on other part of my app I can query that name and temporary disable some action.

I tried to use the same name on multiple methods decorators, but it didn't worked.

e.g some endpoint is down, my UI is server rendered so I can disable some parts of the UI based on CircuitBreakerMonitor.get('circuit_breaker_group_name')._state

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