batchProcess<T = any, R = any>( targets: T[], callback: (prop: T) => Promise<R>, options?: { batchSize?: number },): Promise<R[][]> Parameters
- targets: T[]
- callback: (prop: T) => Promise<R>
Optionaloptions: { batchSize?: number }
Returns Promise<R[][]>
Process items in batches, running items within each batch in parallel, but processing batches sequentially.
This is useful for rate limiting API calls or controlling resource usage.
Example
Note
For simple sequential processing without batching, use native for...of: