• Processes an array of items in chunks, yielding to the main thread between chunks. Enables progress tracking and cancellation for long-running batch operations.

    Type Parameters

    • T
    • R

    Parameters

    • items: T[]

      Array of items to process

    • processor: (chunk: T[]) => Promise<R[]>

      Async function to process each chunk of items

    • options: ChunkedProcessorOptions = {}

      Configuration options for chunking and cancellation

    Returns Promise<R[]>

    Promise resolving to array of results from the processor function

    AbortError if the operation is cancelled via signal.abort()