Skip to content

Defined in: packages/rate-limit/src/keyed-table.ts:58

The options a keyed table needs to bound itself and to build one meter per key.

readonly maxKeyCount: number

Defined in: packages/rate-limit/src/keyed-table.ts:63

The most keys the table holds meters for. A positive safe integer. It bounds the table’s memory; it is not a limit on traffic.


readonly meter: RateMeterFactory

Defined in: packages/rate-limit/src/keyed-table.ts:69

Build one meter for one key. The table calls it with its own clamped reading, so every meter it holds shares one highest reading, and with a built-in factory the meter clamps it again to no effect.


readonly clock: Clock

Defined in: packages/rate-limit/src/keyed-table.ts:71

The time source every meter reads through. The table clamps it once, for all of them.


readonly whenFull: "refuse" | "allow-untracked"

Defined in: packages/rate-limit/src/keyed-table.ts:77

What a request from a key the table cannot hold gets: refuse, or allow-untracked. Required, because neither answer is safe for every server.