Releases: upkie/loop-rate-limiters
v1.0.0
v0.6.1
This patch release fixes the initialization of the slack
attribute in default (synchronous) rate limiters.
[0.6.1] - 2023/10/17
Fixed
- RateLimiter: Initialization of slack attribute
v0.6.0
This update adds a dt
attribute to AsyncRateLimiter
, matching its API better with that of the other RateLimiter
.
Added
- AsyncRateLimiter:
dt
property
Changed
- AsyncRateLimiter:
measured_period
is now a property - AsyncRateLimiter:
next_tick
is now a property - AsyncRateLimiter:
period
is now a property - AsyncRateLimiter:
slack
is now a property
v0.5.0
This minor update adds a warn
keyword argument to the rate limiter constructors. The default behavior is warn=True
as before. Setting warn=False
disables the "clock tick exceeded" warnings. It can be used for instance in applications that are not time critical.
Added
- AsyncRateLimiter:
warn
constructor argument - RateLimiter:
warn
constructor argument
v0.4.0
This minor release updates the synchronous RateLimiter
so that it warns when it is running late, similarly to the asynchronous limiter.
Added
- RateLimiter: warn when the limiter is running late
v0.3.0
This release turns rate limiter internals into read-only properties and adds the RateLimiter.dt
shorthand for convenience. It also introduces installation from conda-forge as a (good) alternative to PyPI.
Added
- Installation from conda-forge
- RateLimiter:
dt
property - RateLimiter:
next_tick
property
Changed
- Attributes are now read-only
- RateLimiter:
period
becomes read-only - RateLimiter:
slack
becomes read-only
v0.2.0
This release adds a rate limiter for asyncio:
import asyncio
from loop_rate_limiters import AsyncRateLimiter
async def main():
rate = AsyncRateLimiter(frequency=400.0)
while True:
loop_time = asyncio.get_event_loop().time()
print(f"Hello from loop at {loop_time:.3f} s")
await rate.sleep()
if __name__ == "__main__":
asyncio.run(main())
Added
- Loop rate limiter for asyncio
v0.1.1
This minor release renames to RateLimiter
the rate limiter based on time.perf_counter
:
from loop_rate_limiters import RateLimiter
from time import perf_counter
rate = RateLimiter(frequency=100.0)
while True:
print(f"Hello from loop at {perf_counter():.3f} s")
rate.sleep()
v0.1.0
This is the initial release of the project: a simple Rate
limiter based on time.perf_counter
:
from loop_rate_limiters import Rate
from time import perf_counter
rate = Rate(frequency=400.0)
while True:
print(f"Hello from loop at {perf_counter():.3f} s")
rate.sleep()