Interface BlockingStream<E>
-
- Type Parameters:
E- The type of the elements, usually aTransferableBlock
public interface BlockingStream<E>An interface that represents an abstract blocking stream of elements that can be consumed. These streams are designed to be consumed by a single thread and do not support null elements.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()Cancels the stream.Eget()Returns the next element on the stream, blocking if there is no element ready.ObjectgetId()The id of the stream.
-
-
-
Method Detail
-
getId
Object getId()
The id of the stream. Mostly used for logging. Implementations of this method must be thread safe.
-
get
E get()
Returns the next element on the stream, blocking if there is no element ready.
-
cancel
void cancel()
Cancels the stream. This method can be called by any thread.
-
-