ParallelExtractionStrategy

Fans all chunks out concurrently on the executor via CompletableFuture, then joins them in input order. A failed extraction yields a null slot.

A caller-supplied executor is never shut down here; a pool created by the no-arg constructor is shut down by close.

Production use requires verifying extractor thread-safety first (see ExtractionExecutionStrategy).

Constructors

Link copied to clipboard
constructor(executor: ExecutorService)

Use a caller-supplied executor; close will not shut it down.

constructor()

Create an internal fixed pool sized to the available processors. The pool is owned by this strategy, so call close (or use it as a resource) when you are done with it.

Functions

Link copied to clipboard
open override fun close()

Shuts down an internally-created pool; a no-op when the executor was caller-supplied.

Link copied to clipboard
open override fun <T> execute(chunks: List<<Error class: unknown class>>, extract: (<Error class: unknown class>) -> T): List<T?>

Apply extract to each chunk, returning results in INPUT ORDER. A null slot at index i means extract(chunks[i]) threw and was caught (see contract above).