import { setImmediate } from 'node:timers/promises'; export const PREPARATION_BATCH_SIZE = 2048; /** Yield to cancellation, timeouts and lease heartbeats between bounded CPU batches. */ export async function preparationCheckpoint(signal?: AbortSignal): Promise { signal?.throwIfAborted(); await setImmediate(); signal?.throwIfAborted(); }