pyrate_limiter.clocks module¶
Clock implementation using different backend
- class pyrate_limiter.clocks.AbstractClock¶
Bases:
ABCClock that return timestamp for now
- abstractmethod now()¶
Get time as of now, in miliseconds
- Return type:
int|Awaitable[int]
- class pyrate_limiter.clocks.MonotonicAsyncClock¶
Bases:
AbstractClockMonotonic Async Clock, meant for testing only
- async now()¶
Get time as of now, in miliseconds
- Return type:
int
- class pyrate_limiter.clocks.MonotonicClock¶
Bases:
AbstractClock- now()¶
Get time as of now, in miliseconds
- class pyrate_limiter.clocks.PostgresClock(pool)¶
Bases:
AbstractClockGet timestamp using Postgres as remote clock backend
- now()¶
Get time as of now, in miliseconds
- Return type:
int