Skip to content

API: Interfaces

This page documents the core interfaces that define the behavior of Fluxgate's components. You can implement these interfaces to create your own custom components (windows, trackers, trippers, retries, permits, and listeners).


fluxgate.interfaces.IWindow

Bases: Protocol

record

record(record: Record) -> None
Source code in fluxgate/interfaces.py
17
def record(self, record: Record) -> None: ...

get_metric

get_metric() -> Metric
Source code in fluxgate/interfaces.py
19
def get_metric(self) -> Metric: ...

reset

reset() -> None
Source code in fluxgate/interfaces.py
21
def reset(self) -> None: ...

fluxgate.interfaces.ITracker

Bases: Protocol

__call__

__call__(exception: Exception) -> bool
Source code in fluxgate/interfaces.py
25
def __call__(self, exception: Exception) -> bool: ...

__and__

__and__(other: Self) -> ITracker
Source code in fluxgate/interfaces.py
27
def __and__(self, other: Self) -> ITracker: ...

__or__

__or__(other: Self) -> ITracker
Source code in fluxgate/interfaces.py
29
def __or__(self, other: Self) -> ITracker: ...

__invert__

__invert__() -> ITracker
Source code in fluxgate/interfaces.py
31
def __invert__(self) -> ITracker: ...

fluxgate.interfaces.ITripper

Bases: Protocol

__call__

__call__(
    metric: Metric,
    state: StateEnum,
    consecutive_failures: int,
) -> bool
Source code in fluxgate/interfaces.py
35
36
37
def __call__(
    self, metric: Metric, state: StateEnum, consecutive_failures: int
) -> bool: ...

__and__

__and__(other: Self) -> ITripper
Source code in fluxgate/interfaces.py
39
def __and__(self, other: Self) -> ITripper: ...

__or__

__or__(other: Self) -> ITripper
Source code in fluxgate/interfaces.py
41
def __or__(self, other: Self) -> ITripper: ...

fluxgate.interfaces.IRetry

Bases: Protocol

__call__

__call__(changed_at: float, reopens: int) -> bool
Source code in fluxgate/interfaces.py
45
def __call__(self, changed_at: float, reopens: int) -> bool: ...

fluxgate.interfaces.IPermit

Bases: Protocol

__call__

__call__(changed_at: float) -> bool
Source code in fluxgate/interfaces.py
49
def __call__(self, changed_at: float) -> bool: ...

fluxgate.interfaces.IListener

Bases: Protocol

__call__

__call__(signal: Signal) -> None
Source code in fluxgate/interfaces.py
53
def __call__(self, signal: Signal) -> None: ...

fluxgate.interfaces.IAsyncListener

Bases: Protocol

__call__ async

__call__(signal: Signal) -> None
Source code in fluxgate/interfaces.py
57
async def __call__(self, signal: Signal) -> None: ...