Defined in: packages/db/src/strategies/types.ts:99
Throttle strategy that spaces executions evenly over time
BaseStrategy<"throttle">
_type: "throttle";Defined in: packages/db/src/strategies/types.ts:8
Type discriminator for strategy identification
cleanup: () => void;Defined in: packages/db/src/strategies/types.ts:30
Clean up any resources held by the strategy Should be called when the strategy is no longer needed
void
execute: <T>(fn, onAdmit?, onCommit?) => boolean | void | Promise<void>;Defined in: packages/db/src/strategies/types.ts:20
Execute a function according to the strategy's timing rules
T extends object = Record<string, unknown>
() => Transaction<T>
The function to execute
() => void | Transaction<T>
Optional synchronous preparation for an admitted call. Built-in debounce/throttle strategies call it after reserving the current edge but before invoking fn, and do not call it when returning false.
() => Promise<unknown> | undefined
Optional promise for the actual commit attempt. It can outlive the public persistence receipt after a manual rollback.
boolean | void | Promise<void>
The result of the function execution (if applicable)
options: ThrottleStrategyOptions;Defined in: packages/db/src/strategies/types.ts:100