from tealtiger.core.circuit import TealCircuit, CircuitState
from tealtiger.core.context import ExecutionContext
from typing import Callable, Optional, TypeVar
T = TypeVar('T')
class TealCircuit:
def __init__(
self,
failure_threshold: int = 5,
timeout: int = 60000,
half_open_requests: int = 3,
on_state_change: Optional[Callable[[CircuitState, CircuitState], None]] = None
):
...
async def execute(self, fn: Callable[[], T]) -> T:
...
def evaluate(self, context: Optional[ExecutionContext] = None) -> Decision:
...
def get_state(self) -> CircuitState:
...
def reset(self) -> None:
...