RateLimited Filter

template<typename T, uint32_t MinIntervalMs>
struct RateLimited

Filter that limits propagation rate to minimum interval.

This stateful filter ensures a minimum time interval (in milliseconds) between propagated changes, useful for rate limiting updates or API calls.

Since

v0.1.0

// Example: Limit to one update every 100ms
Signal<int, 10, RateLimited<int, 100>> throttled(0);

Note

Stateful filter. Uses millis() for timing.

Warning

  • MinIntervalMs must be greater than 0.

Template Parameters:
typename T

Any type.

uint32_t MinIntervalMs

Minimum interval between propagations in milliseconds.

Public Functions

inline bool operator()(const T &old_value, const T &new_value) const

Public Members

mutable uint32_t last_propagation = 0

See Also