Pudu programming language
Menu
API reference

Std.Http.Server.Guard.rateLimitedTracking

1 declaration

fn

rateLimitedTracking: Int -> Int -> Int -> fn(Std.Http.Server.Route.Request, fn(Std.Http.Server.Route.Request) -> Std.Http.Response) -> Std.Http.Response

This is a callable function.

What it does

A rate limiter remembering at most peers peers.

The table is bounded because a server that stays up meets an unbounded

number of addresses, and one that remembered each would grow with every one

of them. The peer seen least recently is forgotten to make room, and starts a

fresh window when it returns: the answer it would have had once its window

ended. A refused peer counts as seen, so a flood of new addresses cannot

push a peer that is being refused out of the table and hand it a new window.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.

Back to Std.Http.Server.GuardSearch related declarations