/** * Elastic throttle with two independent inputs: * * 1. **User throttle** — set explicitly via quorum `throttle` command. * Absolute value: 0 = resume, >0 = delay per message, -1 = pause. * * 2. **Duress floor** — set automatically by the DuressManager based on * processing latency. The effective throttle is `max(user, duress)`, * so duress never reduces below what the user set, and pause always * takes precedence. When duress clears (floor returns to 0), the * user's original throttle remains in effect. * * `customSleep()` uses the effective throttle, supports dynamic * interruption (if the throttle decreases mid-sleep, the router wakes * early), and handles pause via a bare promise with no timer. */ export declare class ThrottleManager { private throttle; private duressFloor; private isSleeping; private sleepPromiseResolve; private innerPromiseResolve; private sleepTimeout; constructor(initialThrottle?: number); getThrottle(): number; /** * Set the duress-computed throttle floor. The effective throttle * is max(userThrottle, duressFloor). Pause (throttle < 0) overrides. */ setDuressFloor(delayMs: number): void; getDuressFloor(): number; /** * Returns the effective throttle: max of user-set throttle and * duress floor. Pause (negative) always takes precedence. */ getEffectiveThrottle(): number; setThrottle(delayInMillis: number): void; isPaused(): boolean; /** * An adjustable throttle that will interrupt a sleeping * router if the throttle is reduced and the sleep time * has elapsed. If the throttle is increased, or if * the sleep time has not elapsed, the router will continue * to sleep until the new termination point. This * allows for dynamic, elastic throttling with smooth * acceleration and deceleration. * * When paused (throttle < 0), waits indefinitely via a bare * promise — no setTimeout timer. Resumes instantly when * setThrottle() is called with a non-negative value. */ customSleep(): Promise; cancelThrottle(): void; private resetThrottleState; }