tmax window before running any other gate. If the remaining budget falls below a configurable threshold, it returns skipped: true and — because the engine runs fail-fast — all subsequent gates are bypassed. This keeps your gate pipeline from doing meaningful work on a bid that has already missed its serve deadline.
Usage
Place
tmaxGuard first in every RTB gate list. It is the only gate designed to short-circuit the entire pipeline on deadline exhaustion.Options
number
default:"15"
The minimum number of milliseconds that must remain in the
tmax window for downstream gates to run. If the remaining budget is less than this value, the gate returns skipped: true. Defaults to 15.string
default:"rtb.tmax-guard"
Override the gate’s name in evaluation results and telemetry.
Required context fields
The gate reads two fields fromEvaluationContext. If either is absent, the gate passes through silently — it cannot enforce a deadline it cannot measure.
Date.now() - startedAt at the moment it runs, then checks whether tmaxMs - elapsed < bufferMs.
What “skipped” means
Askipped result is not a failure. The gate result looks like this:
When context fields are missing
IftmaxMs or startedAt is not a number on the context, the gate returns: