MCPcopy Create free account

hub / github.com/danielfm/pybreaker / functions

Functions206 in github.com/danielfm/pybreaker

↓ 73 callersMethodcall
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 callersMethod_namespace
(self, key: str)
src/pybreaker/__init__.py:639
↓ 10 callersMethodadd_listener
Register a listener for this circuit breaker.
src/pybreaker/__init__.py:334
↓ 5 callersMethod__init__
Create a new circuit breaker with the given parameters.
src/pybreaker/__init__.py:91
↓ 5 callersMethodopen
Open the circuit, e.g., the following calls will immediately fail until timeout elapses.
src/pybreaker/__init__.py:281
↓ 4 callersMethod_handle_success
Handle a successful call to the guarded operation.
src/pybreaker/__init__.py:702
↓ 4 callersMethod_start_threads
Starts `n` threads that calls `target` and waits for them to finish.
tests/pybreaker_test.py:1047
↓ 4 callersMethod_start_threads
Starts `n` threads that calls `target` and waits for them to finish.
tests/pybreaker_test.py:1189
↓ 4 callersMethodadd_excluded_exception
Add an exception to the list of excluded exceptions.
src/pybreaker/__init__.py:212
↓ 4 callersMethodhalf_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 callersMethod_create_new_state
Return state object from state string, i.e., 'closed' -> <CircuitClosedState>.
src/pybreaker/__init__.py:159
↓ 3 callersMethod_handle_error
(self, exc: BaseException, reraise: Literal[True] = ...)
src/pybreaker/__init__.py:682
↓ 3 callersMethodbefore_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 callersMethodclose
Close the circuit, e.g. lets the following calls execute as usual.
src/pybreaker/__init__.py:297
↓ 3 callersMethodreset_success_counter
Set the success counter to zero.
src/pybreaker/__init__.py:566
↓ 3 callersMethodstate_change
This callback function is called when the state of the circuit breaker `cb` state changes.
src/pybreaker/__init__.py:659
↓ 2 callersMethod_initialize_redis_state
(self, state: str)
src/pybreaker/__init__.py:509
↓ 2 callersMethodbefore_call
Override this method to be notified before a call to the guarded operation is attempted.
src/pybreaker/__init__.py:770
↓ 2 callersMethodcall_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 callersMethodcalling
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 callersMethodgenerator_call
(self, wrapped_generator)
src/pybreaker/__init__.py:758
↓ 2 callersMethodincrement_counter
Increase the failure counter by one.
src/pybreaker/__init__.py:545
↓ 2 callersMethodreset_counter
Set the failure counter to zero.
src/pybreaker/__init__.py:552
↓ 1 callersMethod_inc_counter
Increment the counter of failed calls.
src/pybreaker/__init__.py:227
↓ 1 callersMethod_mock_function
Replaces a bounded function in `self.breaker` by another.
tests/pybreaker_test.py:1053
↓ 1 callersMethod_mock_function
Replaces a bounded function in `self.breaker` by another.
tests/pybreaker_test.py:1195
↓ 1 callersMethodadd_excluded_exceptions
Add exceptions to the list of excluded exceptions.
src/pybreaker/__init__.py:217
↓ 1 callersMethodadd_listeners
Register listeners for this circuit breaker.
src/pybreaker/__init__.py:339
↓ 1 callersMethodfailure
This callback function is called when a function called by the circuit breaker `cb` fails.
src/pybreaker/__init__.py:653
↓ 1 callersMethodfoo
(self)
tests/pybreaker_test.py:374
↓ 1 callersMethodincrement_counter
Increase the failure counter by one.
src/pybreaker/__init__.py:437
↓ 1 callersMethodincrement_success_counter
Increase the success counter by one.
src/pybreaker/__init__.py:559
↓ 1 callersMethodis_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 callersMethodon_failure
Override this method to be notified when a call to the guarded operation fails.
src/pybreaker/__init__.py:776
↓ 1 callersMethodon_success
Override this method to be notified when a call to the guarded operation succeeds.
src/pybreaker/__init__.py:773
↓ 1 callersMethodremove_excluded_exception
Remove an exception from the list of excluded exceptions.
src/pybreaker/__init__.py:222
↓ 1 callersMethodremove_listener
Unregister a listener of this circuit breaker.
src/pybreaker/__init__.py:344
↓ 1 callersMethodsuccess
This callback function is called when a function called by the circuit breaker `cb` succeeds.
src/pybreaker/__init__.py:656
↓ 1 callersMethodwrapper
(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
Methodbefore_call
This callback function is called before the circuit breaker `cb` calls `fn`.
src/pybreaker/__init__.py:650
Methodbefore_call
(self, cb, func, *args, **kwargs)
tests/pybreaker_test.py:315
Methodbefore_call
(self, cb, fun, *args, **kwargs)
tests/pybreaker_test.py:1134
Methodbefore_call
(self, cb, func, *args, **kwargs)
tests/pybreaker_test.py:1164
Methodbefore_call
(self, cb, fun, *args, **kwargs)
tests/pybreaker_test.py:1275
Methodbefore_call
(self, cb, func, *args, **kwargs)
tests/pybreaker_test.py:1309
Methodcall
Calls `func` with the given `args` and `kwargs`, and updates the circuit breaker state according to the result.
src/pybreaker/__init__.py:709
Methodcall
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
Methodcall_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
Methodcounter
Override this method to retrieve the current value of the failure counter.
src/pybreaker/__init__.py:398
Methodcounter
Return the current value of the failure counter.
src/pybreaker/__init__.py:454
Methodcounter
Return the current value of the failure counter.
src/pybreaker/__init__.py:574
Methodcurrent_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
Methoderr
()
tests/pybreaker_test.py:53
Methoderr
Docstring
tests/pybreaker_test.py:681
Methoderr
()
tests/pybreaker_test.py:1067
Methoderr
()
tests/pybreaker_test.py:1209
Methoderr_1
()
tests/pybreaker_test.py:546
Methoderr_2
()
tests/pybreaker_test.py:549
Methoderr_3
()
tests/pybreaker_test.py:552
Methoderr_4
()
tests/pybreaker_test.py:624
Methodexcluded_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
Methodfail_counter
Return the current number of consecutive failures.
src/pybreaker/__init__.py:118
Methodfail_max
Return the maximum number of failures tolerated before the circuit is opened.
src/pybreaker/__init__.py:128
Methodfailure
(self, cb, exc)
tests/pybreaker_test.py:323
Methodfun
()
tests/pybreaker_test.py:212
Methodfun
()
tests/pybreaker_test.py:752
Methodfunc
()
tests/pybreaker_test.py:25
Methodfunc
()
tests/pybreaker_test.py:457
Methodfunc
()
tests/pybreaker_test.py:973
Methodincrement_counter
Override this method to increase the failure counter by one.
src/pybreaker/__init__.py:384
Methodincrement_success_counter
Override this method to increase the success counter by one.
src/pybreaker/__init__.py:390
Methodincrement_success_counter
Increase the success counter by one.
src/pybreaker/__init__.py:445
Methodlisteners
Return the registered listeners as a tuple.
src/pybreaker/__init__.py:330
Methodname
Return the name of this circuit breaker. Useful for logging.
src/pybreaker/__init__.py:350
Methodname
Return a human friendly name that identifies this state.
src/pybreaker/__init__.py:371
Methodname
Return a human friendly name that identifies this state.
src/pybreaker/__init__.py:677
Methodon_failure
Move the circuit breaker to the "open" state once the failures threshold is reached.
src/pybreaker/__init__.py:807
Methodon_failure
Opens the circuit breaker.
src/pybreaker/__init__.py:883
Methodon_success
Increment success counter and close the circuit breaker if threshold is reached.
src/pybreaker/__init__.py:892
Methodopened_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