Parallel OsidList Pattern

Merge many lists concurrently — elements in arrival order.

Overview

A parallel OsidList merges N source lists into a single stream. Each source is buffered independently on its own virtual thread, and elements are handed to the consumer in arrival order — whichever source produces next. Where a composite list drains its sources one after another, a parallel list reads them all at once and interleaves the results.

Intended for single-consumer use, per the OsidList contract. By default a reader error aborts iteration; in soft mode the error is recorded without stopping the remaining readers.

Javadoc Reference

net.okapia.osid.streams.spi

Class Declaration Pattern

public final class ParallelOsidObjectList
extends AbstractParallelOsidList<OsidObject>
implements OsidObjectList

Constructor Pattern

ParallelOsidObjectList()

Creates a parallel list with a default per-reader buffer size and hard-error handling.

ParallelOsidObjectList(int bufferSize, boolean soft)
ParameterTypeDescription
bufferSize int the capacity of each reader's bounded buffer
soft boolean if true, a reader error is recorded without aborting iteration of the remaining readers

Adding Sources

public void addOsidObjectList(OsidObjectList list)
ParameterTypeDescription
list OsidObjectList a source list to be merged concurrently with the others