gatelineAPI reference

A granted slot. It counts against the cap and, at its estimate, against the spend window until it is released. commit() records that the intent commit landed and the dispatch is running; release() gives the slot back and may be called any number of times — only the first call counts.

Releasing a committed reservation records what the dispatch cost, so the spend window keeps counting it until the repository's next report shows it in the ledger: pass the real cost when it is known, and the estimate is used when it is not. Releasing one that was never committed records nothing — no intent landed, so nothing was spent.

interface Reservation {
    committed: boolean;
    estimateUsd: number;
    key: string;
    ledgerAt: null | string;
    released: boolean;
    repository: string;
    commit(ledgerAt?: null | string): void;
    release(costUsd?: null | number): void;
}

Properties

committed: boolean
estimateUsd: number
key: string
ledgerAt: null | string

The at of the ledger entry (or sweep marker) the intent commit wrote, once committed.

released: boolean
repository: string

Methods

  • The intent commit landed. ledgerAt is the at it wrote on the ledger entry or sweep marker: with the key, it is how the governor recognises this dispatch among a report's closed entries, and so never counts it twice. A retry reuses its key, so the key alone would not do.

    Parameters

    • OptionalledgerAt: null | string

    Returns void