Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
RateLimiter Class Reference

Public Member Functions

None __init__ (self, float min_update_interval_seconds)
 
bool ready (self)
 
None reset (self)
 

Protected Attributes

 _min_update_interval_seconds
 
 _last_update
 

Detailed Description

Definition at line 101 of file spinners.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ (   self,
float  min_update_interval_seconds 
)

Definition at line 102 of file spinners.py.

102 def __init__(self, min_update_interval_seconds: float) -> None:
103 self._min_update_interval_seconds = min_update_interval_seconds
104 self._last_update: float = 0
105

Referenced by Protocol.__init_subclass__().

Here is the caller graph for this function:

Member Function Documentation

◆ ready()

bool ready (   self)

Definition at line 106 of file spinners.py.

106 def ready(self) -> bool:
107 now = time.time()
108 delta = now - self._last_update
109 return delta >= self._min_update_interval_seconds
110
for i

References RateLimiter._last_update, RateLimiter._min_update_interval_seconds, and i.

◆ reset()

None reset (   self)

Definition at line 111 of file spinners.py.

111 def reset(self) -> None:
112 self._last_update = time.time()
113
114
115@contextlib.contextmanager

Field Documentation

◆ _last_update

_last_update
protected

Definition at line 112 of file spinners.py.

Referenced by RateLimiter.ready().

◆ _min_update_interval_seconds

_min_update_interval_seconds
protected

Definition at line 103 of file spinners.py.

Referenced by RateLimiter.ready().


The documentation for this class was generated from the following file: