# BatchedScreenshotProcessor

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-12-screenshots/batched-screenshot-processor.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-12-screenshots/batched-screenshot-processor.ts#L70)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `splitIntoBatches` | `splitIntoBatches(mappings: ScreenshotMapping[], batchSize: number)` | `ScreenshotMapping[][]` |
| `processInBatches` | `processInBatches(mappings: ScreenshotMapping[], documents: GeneratedDocument[], registry: ScreenshotRegistry, capturer: { captureScreenshots: (mappings: ScreenshotMapping[], progressCallback?: any) => Promise<CaptureResult[]> }, replacer: { replaceInDocuments: (documents: GeneratedDocument[], screenshots: CapturedScreenshot[], registry: ScreenshotRegistry, progressCallback?: any) => { documents: GeneratedDocument[]; results: any[] } }, config: BatchConfig)` | `Promise<AggregatedResult>` |

## Where it refuses work

- `BatchedScreenshotProcessor` stops the work with an early return when `mappings.length === 0`.
- `BatchedScreenshotProcessor` stops the work with an early return when `batches.length === 0`.

## When something fails

- `BatchedScreenshotProcessor` handles failure in 1 place: it logs it and continues in all 1.
