sliding property

bool sliding
final

Use a sliding window. The count is then a guess of the requests in the last per: the count of this window plus a part of the count of the window before. That part gets smaller as this window goes on. Eg. 30% into this window, 70% of the last count is added. It stops the burst of 2 x max at the edge of a window. It costs one more read per request, and each count is kept for 2 windows.

Retry-After is the time until one more request fits, if the client sends nothing in between.

Implementation

final bool sliding;