Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/danielfm/pybreaker
/ functions
Functions
206 in github.com/danielfm/pybreaker
⨍
Functions
206
◇
Types & classes
29
↳
Endpoints
3
↓ 73 callers
Method
call
Call `func` with the given `args` and `kwargs` according to the rules implemented by the current state of this circuit breaker.
src/pybreaker/__init__.py:246
↓ 13 callers
Method
_namespace
(self, key: str)
src/pybreaker/__init__.py:639
↓ 10 callers
Method
add_listener
Register a listener for this circuit breaker.
src/pybreaker/__init__.py:334
↓ 5 callers
Method
__init__
Create a new circuit breaker with the given parameters.
src/pybreaker/__init__.py:91
↓ 5 callers
Method
open
Open the circuit, e.g., the following calls will immediately fail until timeout elapses.
src/pybreaker/__init__.py:281
↓ 4 callers
Method
_handle_success
Handle a successful call to the guarded operation.
src/pybreaker/__init__.py:702
↓ 4 callers
Method
_start_threads
Starts `n` threads that calls `target` and waits for them to finish.
tests/pybreaker_test.py:1047
↓ 4 callers
Method
_start_threads
Starts `n` threads that calls `target` and waits for them to finish.
tests/pybreaker_test.py:1189
↓ 4 callers
Method
add_excluded_exception
Add an exception to the list of excluded exceptions.
src/pybreaker/__init__.py:212
↓ 4 callers
Method
half_open
Half-open the circuit, e.g. lets the following call pass through and opens the circuit if the call fails (or closes the circuit if the call
src/pybreaker/__init__.py:289
↓ 3 callers
Method
_create_new_state
Return state object from state string, i.e., 'closed' -> <CircuitClosedState>.
src/pybreaker/__init__.py:159
↓ 3 callers
Method
_handle_error
(self, exc: BaseException, reraise: Literal[True] = ...)
src/pybreaker/__init__.py:682
↓ 3 callers
Method
before_call
After the timeout elapses, move the circuit breaker to the "half-open" state; otherwise, raises ``CircuitBreakerError`` without any attempt
src/pybreaker/__init__.py:841
↓ 3 callers
Method
close
Close the circuit, e.g. lets the following calls execute as usual.
src/pybreaker/__init__.py:297
↓ 3 callers
Method
reset_success_counter
Set the success counter to zero.
src/pybreaker/__init__.py:566
↓ 3 callers
Method
state_change
This callback function is called when the state of the circuit breaker `cb` state changes.
src/pybreaker/__init__.py:659
↓ 2 callers
Method
_initialize_redis_state
(self, state: str)
src/pybreaker/__init__.py:509
↓ 2 callers
Method
before_call
Override this method to be notified before a call to the guarded operation is attempted.
src/pybreaker/__init__.py:770
↓ 2 callers
Method
call_async
Call async `func` with the given `args` and `kwargs` according to the rules implemented by the current state of this circuit breaker.
src/pybreaker/__init__.py:266
↓ 2 callers
Method
calling
Return a context manager, enabling the circuit breaker to be used with a `with` statement. The block of code inside the `with` statement will
src/pybreaker/__init__.py:254
↓ 2 callers
Method
generator_call
(self, wrapped_generator)
src/pybreaker/__init__.py:758
↓ 2 callers
Method
increment_counter
Increase the failure counter by one.
src/pybreaker/__init__.py:545
↓ 2 callers
Method
reset_counter
Set the failure counter to zero.
src/pybreaker/__init__.py:552
↓ 1 callers
Method
_inc_counter
Increment the counter of failed calls.
src/pybreaker/__init__.py:227
↓ 1 callers
Method
_mock_function
Replaces a bounded function in `self.breaker` by another.
tests/pybreaker_test.py:1053
↓ 1 callers
Method
_mock_function
Replaces a bounded function in `self.breaker` by another.
tests/pybreaker_test.py:1195
↓ 1 callers
Method
add_excluded_exceptions
Add exceptions to the list of excluded exceptions.
src/pybreaker/__init__.py:217
↓ 1 callers
Method
add_listeners
Register listeners for this circuit breaker.
src/pybreaker/__init__.py:339
↓ 1 callers
Method
failure
This callback function is called when a function called by the circuit breaker `cb` fails.
src/pybreaker/__init__.py:653
↓ 1 callers
Method
foo
(self)
tests/pybreaker_test.py:374
↓ 1 callers
Method
increment_counter
Increase the failure counter by one.
src/pybreaker/__init__.py:437
↓ 1 callers
Method
increment_success_counter
Increase the success counter by one.
src/pybreaker/__init__.py:559
↓ 1 callers
Method
is_system_error
Return whether the exception `exception` is considered a signal of system malfunction. Business exceptions should not cause this circuit
src/pybreaker/__init__.py:231
↓ 1 callers
Method
on_failure
Override this method to be notified when a call to the guarded operation fails.
src/pybreaker/__init__.py:776
↓ 1 callers
Method
on_success
Override this method to be notified when a call to the guarded operation succeeds.
src/pybreaker/__init__.py:773
↓ 1 callers
Method
remove_excluded_exception
Remove an exception from the list of excluded exceptions.
src/pybreaker/__init__.py:222
↓ 1 callers
Method
remove_listener
Unregister a listener of this circuit breaker.
src/pybreaker/__init__.py:344
↓ 1 callers
Method
success
This callback function is called when a function called by the circuit breaker `cb` succeeds.
src/pybreaker/__init__.py:656
↓ 1 callers
Method
wrapper
(self)
tests/pybreaker_test.py:368
Method
__call__
Return a wrapper that calls the function `func` according to the rules implemented by the current state of this circuit breaker. Opti
src/pybreaker/__init__.py:303
Method
__init__
Create a new instance identified by `name`.
src/pybreaker/__init__.py:366
Method
__init__
Create a new instance with the given `state`.
src/pybreaker/__init__.py:419
Method
__init__
Create a new instance with the given `state` and `redis` object. The redis object should be similar to pyredis' StrictRedis class. If there
src/pybreaker/__init__.py:481
Method
__init__
Create a new instance associated with the circuit breaker `cb` and identified by `name`.
src/pybreaker/__init__.py:671
Method
__init__
Move the given circuit breaker `cb` to the "closed" state.
src/pybreaker/__init__.py:789
Method
__init__
Move the given circuit breaker `cb` to the "open" state.
src/pybreaker/__init__.py:827
Method
__init__
Move the given circuit breaker `cb` to the "half-open" state.
src/pybreaker/__init__.py:869
Method
__init__
(self)
tests/pybreaker_test.py:17
Method
__init__
(self)
tests/pybreaker_test.py:273
Method
__init__
(self, value)
tests/pybreaker_test.py:578
Method
__init__
(self)
tests/pybreaker_test.py:1131
Method
__init__
(self)
tests/pybreaker_test.py:1272
Method
_do_raise
()
tests/pybreaker_test.py:1330
Method
_do_succeed
()
tests/pybreaker_test.py:1334
Method
_inc_counter
(self)
tests/pybreaker_test.py:1077
Method
_inc_counter
(self)
tests/pybreaker_test.py:1219
Method
_inner_wrapper
(*args, **kwargs)
src/pybreaker/__init__.py:318
Method
_outer_wrapper
(func)
src/pybreaker/__init__.py:316
Method
_wrapper
()
src/pybreaker/__init__.py:261
Method
before_call
This callback function is called before the circuit breaker `cb` calls `fn`.
src/pybreaker/__init__.py:650
Method
before_call
(self, cb, func, *args, **kwargs)
tests/pybreaker_test.py:315
Method
before_call
(self, cb, fun, *args, **kwargs)
tests/pybreaker_test.py:1134
Method
before_call
(self, cb, func, *args, **kwargs)
tests/pybreaker_test.py:1164
Method
before_call
(self, cb, fun, *args, **kwargs)
tests/pybreaker_test.py:1275
Method
before_call
(self, cb, func, *args, **kwargs)
tests/pybreaker_test.py:1309
Method
call
Calls `func` with the given `args` and `kwargs`, and updates the circuit breaker state according to the result.
src/pybreaker/__init__.py:709
Method
call
Delegate the call to before_call, if the time out is not elapsed it will throw an exception, otherwise we get the results from the call perfor
src/pybreaker/__init__.py:854
Method
call_async
Call async `func` with the given `args` and `kwargs`, and updates the circuit breaker state according to the result. Return a closure
src/pybreaker/__init__.py:730
Method
counter
Override this method to retrieve the current value of the failure counter.
src/pybreaker/__init__.py:398
Method
counter
Return the current value of the failure counter.
src/pybreaker/__init__.py:454
Method
counter
Return the current value of the failure counter.
src/pybreaker/__init__.py:574
Method
current_state
Return a string that identifies the state of the circuit breaker as reported by the _state_storage. i.e., 'closed', 'open', 'half-open'.
src/pybreaker/__init__.py:197
Method
err
()
tests/pybreaker_test.py:53
Method
err
Docstring
tests/pybreaker_test.py:681
Method
err
()
tests/pybreaker_test.py:1067
Method
err
()
tests/pybreaker_test.py:1209
Method
err_1
()
tests/pybreaker_test.py:546
Method
err_2
()
tests/pybreaker_test.py:549
Method
err_3
()
tests/pybreaker_test.py:552
Method
err_4
()
tests/pybreaker_test.py:624
Method
excluded_exceptions
Return the list of excluded exceptions, e.g., exceptions that should not be considered system errors by this circuit breaker.
src/pybreaker/__init__.py:204
Method
fail_counter
Return the current number of consecutive failures.
src/pybreaker/__init__.py:118
Method
fail_max
Return the maximum number of failures tolerated before the circuit is opened.
src/pybreaker/__init__.py:128
Method
failure
(self, cb, exc)
tests/pybreaker_test.py:323
Method
fun
()
tests/pybreaker_test.py:212
Method
fun
()
tests/pybreaker_test.py:752
Method
func
()
tests/pybreaker_test.py:25
Method
func
()
tests/pybreaker_test.py:457
Method
func
()
tests/pybreaker_test.py:973
Method
increment_counter
Override this method to increase the failure counter by one.
src/pybreaker/__init__.py:384
Method
increment_success_counter
Override this method to increase the success counter by one.
src/pybreaker/__init__.py:390
Method
increment_success_counter
Increase the success counter by one.
src/pybreaker/__init__.py:445
Method
listeners
Return the registered listeners as a tuple.
src/pybreaker/__init__.py:330
Method
name
Return the name of this circuit breaker. Useful for logging.
src/pybreaker/__init__.py:350
Method
name
Return a human friendly name that identifies this state.
src/pybreaker/__init__.py:371
Method
name
Return a human friendly name that identifies this state.
src/pybreaker/__init__.py:677
Method
on_failure
Move the circuit breaker to the "open" state once the failures threshold is reached.
src/pybreaker/__init__.py:807
Method
on_failure
Opens the circuit breaker.
src/pybreaker/__init__.py:883
Method
on_success
Increment success counter and close the circuit breaker if threshold is reached.
src/pybreaker/__init__.py:892
Method
opened_at
Override this method to retrieve the most recent value of when the circuit was opened.
src/pybreaker/__init__.py:408
next →
1–100 of 206, ranked by callers