/** * scheduleUnits โ€” the bounded scheduler of the execution substrate (north-star * ยง5.8, release 2.13.0). * * Owns the scheduling SHAPE โ€” a `parallel` sliding window bounded by `maxParallel`, * or a `sequential` one-at-a-time loop โ€” plus the stop policy and an external * abort check. The per-unit lifecycle (timeout/retry/result) is the caller's * `runUnit`, which returns whether scheduling should stop (the domain's * `stopOnFirstFailure` decision). This is the one loop fit + sim run on, replacing * their hand-rolled parallel pools and `for-of` loops (the `same-recipe-semantics` * guarantee). * * Faithfully generalized from fitness's `executeParallel` (sliding window: launch * up to `maxParallel`, refill on each completion unless stopping/aborted, resolve * when drained) and `executeSequential` (`for-of`, abort-check at the top, break * on stop). */ export interface ScheduleUnitsOptions { readonly units: readonly Unit[]; readonly mode: 'parallel' | 'sequential'; /** Concurrency bound in `parallel` mode (ignored for `sequential`). Default 1. */ readonly maxParallel?: number; /** * Run one unit (its full timeout/retry/result lifecycle) and report whether the * scheduler should stop launching further units. Receives the 0-based index. */ readonly runUnit: (unit: Unit, index: number) => Promise<{ readonly shouldStop: boolean; }>; /** External abort check (e.g. a service-level AbortController); polled before each launch. */ readonly shouldAbort?: () => boolean; } /** Schedule `units` through `runUnit` per the mode/concurrency/stop policy. */ export declare function scheduleUnits(opts: ScheduleUnitsOptions): Promise; //# sourceMappingURL=schedule.d.ts.map