A concurrent producer/consumer list — push elements, pull elsewhere.
A piped OsidList is a concurrent
producer/consumer list. The producer pushes elements in with
addOsidObject and signals
completion with finish(); a single consumer pulls
them out through the standard
getNextOsidObject(). The
two sides may run on different threads, handing off through an
internal blocking queue.
If the producer hits a problem it calls
error() instead of finish(); the
exception surfaces on the consumer side as an
OperationFailedException at the next read.
available() reports the number of elements offered by
the producer and not yet consumed — always safe to pass to
getNextOsidObjects()
without blocking. Assumes a single consumer thread.
No parameters. Construct the list, hand it to the consumer, and feed it from the producer thread.
Signals that the producer has offered its
last element. After finish() the consumer drains any
remaining elements and then reaches end-of-list.
| Parameter | Type | Description |
|---|---|---|
e |
OsidException |
the failure to raise on the consumer side as an OperationFailedException at its next read |