Skip to main content

RateLimitObserver

@retinue/monorepo


@retinue/monorepo / backend/src / RateLimitObserver

Interface: RateLimitObserver

Defined in: backend/src/usage/rate-limit.ts:113

Told when a tenant is refused.

A sink of its own rather than a RunEvent, and the reason is the one QuotaObserver already gives: a RunEvent carries a runId, and this fires before a run exists — which is the whole point of refusing at admission. Squeezing it into the run stream would mean inventing a run id for an event about not starting one.

Methods​

onRefusal()​

onRefusal(context, refusal): void | Promise<void>

Defined in: backend/src/usage/rate-limit.ts:114

Parameters​

context​

ExecutionContext

refusal​
admitted​

false

limit​

number

message​

string

resetsAt​

string

retryAfterMs​

number

used​

number

windowSeconds​

number

Returns​

void | Promise<void>