export interface CoalescerLoaders { /** Loads one key on its own: lone calls, and each key of a failed batch. */ one: (key: string) => Promise; /** Loads several keys in one round-trip; keys absent from the map are null. */ many: (keys: string[]) => Promise>; /** Most keys one `many()` statement carries; bigger bursts split. */ maxBatch: number; /** When true, `load()` runs `one()` right away (e.g. inside a transaction). */ unbatched: () => boolean; } /** * Answers every `load()` issued in the same synchronous run with one `many()` * call at the next microtask. That is how just-bash fans out * (`Promise.all(names.map((n) => fs.stat(n)))`), so a burst costs one * round-trip instead of a pool's worth of waves. Callers must reach `load()` * before their first `await`; duplicate keys share one slot. * * Batching never changes what a caller gets. A lone key runs `one()`, and if * a `many()` statement fails (a path that can't be encoded, a statement * timeout, anything), each of its keys is retried through `one()`, so every * caller settles exactly as it would have without batching. `maxBatch` keeps * one statement from carrying a whole tree's worth of content under a single * statement timeout. */ export declare class Coalescer { private readonly loaders; private pending; constructor(loaders: CoalescerLoaders); load(key: string): Promise; private flush; private settleMany; private settleOne; } //# sourceMappingURL=coalescer.d.ts.map