Skip to content

BatchedScreenshotProcessor

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-12-screenshots/batched-screenshot-processor.ts

Methods

MethodSignatureReturns
splitIntoBatchessplitIntoBatches(mappings: ScreenshotMapping[], batchSize: number)ScreenshotMapping[][]
processInBatchesprocessInBatches(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.

Was this page helpful?

Download as PDF