import type { Runner } from "./runner.js"; import type { RunnerFactory } from "./runner-factory.js"; export interface RetryOptions { /** How many times to build a fresh runner and try again. Defaults to 1. */ retries?: number; } /** * A `Runner` that builds its own from a factory, and on failure throws it away * and tries again with a new one. A runner that has died stays dead, so * replacing it is the only recovery there is. * * ```ts * const runner = new RetryingRunner(factory, { retries: 2 }); * ``` * * The runner is built on the first `send`, not up front, so nothing starts * until there is work for it. */ export declare class RetryingRunner implements Runner { private readonly factory; private readonly retries; private runner; private creating; private isDisposed; constructor(factory: RunnerFactory, opts?: RetryOptions); send(input: Input): Promise; dispose(): void; private create; private discard; }