Package org.osgi.util.pushstream
Class BufferedPushStreamImpl<T,U extends BlockingQueue<PushEvent<? extends T>>>
java.lang.Object
org.osgi.util.pushstream.AbstractPushStreamImpl<T>
org.osgi.util.pushstream.UnbufferedPushStreamImpl<T,U>
org.osgi.util.pushstream.BufferedPushStreamImpl<T,U>
- All Implemented Interfaces:
AutoCloseable
,PushStream<T>
class BufferedPushStreamImpl<T,U extends BlockingQueue<PushEvent<? extends T>>>
extends UnbufferedPushStreamImpl<T,U>
implements PushStream<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.osgi.util.pushstream.AbstractPushStreamImpl
AbstractPushStreamImpl.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final U
private final int
private final PushbackPolicy<T,
U> private final QueuePolicy<T,
U> private final Semaphore
private final AtomicBoolean
Indicates that a terminal event has been received, that we should stop collecting new events, and that we must drain the buffer before continuingFields inherited from class org.osgi.util.pushstream.UnbufferedPushStreamImpl
connector, upstream
Fields inherited from class org.osgi.util.pushstream.AbstractPushStreamImpl
closed, next, onCloseCallback, onErrorCallback, promiseFactory, psp
-
Constructor Summary
ConstructorsConstructorDescriptionBufferedPushStreamImpl
(PushStreamProvider psp, PromiseFactory promiseFactory, U eventQueue, int parallelism, QueuePolicy<T, U> queuePolicy, PushbackPolicy<T, U> pushbackPolicy, Function<PushEventConsumer<T>, AutoCloseable> connector) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
handleEvent
(PushEvent<? extends T> event) private void
Methods inherited from class org.osgi.util.pushstream.UnbufferedPushStreamImpl
begin, close, upstreamClose
Methods inherited from class org.osgi.util.pushstream.AbstractPushStreamImpl
adjustBackPressure, adjustBackPressure, allMatch, anyMatch, asyncMap, buffer, buildBuffer, check, close, close, coalesce, coalesce, coalesce, collect, count, distinct, filter, findAny, findFirst, flatMap, forEach, forEachEvent, fork, getQueueForInternalBuffering, limit, limit, map, max, merge, merge, min, noneMatch, onClose, onError, reduce, reduce, reduce, sequential, skip, sorted, sorted, split, timeout, toArray, toArray, window, window, window, window
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.osgi.util.pushstream.PushStream
adjustBackPressure, adjustBackPressure, allMatch, anyMatch, asyncMap, buffer, buildBuffer, close, coalesce, coalesce, coalesce, collect, count, distinct, filter, findAny, findFirst, flatMap, forEach, forEachEvent, fork, limit, limit, map, max, merge, merge, min, noneMatch, onClose, onError, reduce, reduce, reduce, sequential, skip, sorted, sorted, split, timeout, toArray, toArray, window, window, window, window
-
Field Details
-
eventQueue
-
semaphore
-
queuePolicy
-
pushbackPolicy
-
softClose
Indicates that a terminal event has been received, that we should stop collecting new events, and that we must drain the buffer before continuing -
parallelism
private final int parallelism
-
-
Constructor Details
-
BufferedPushStreamImpl
BufferedPushStreamImpl(PushStreamProvider psp, PromiseFactory promiseFactory, U eventQueue, int parallelism, QueuePolicy<T, U> queuePolicy, PushbackPolicy<T, U> pushbackPolicy, Function<PushEventConsumer<T>, AutoCloseable> connector)
-
-
Method Details
-
handleEvent
- Overrides:
handleEvent
in classAbstractPushStreamImpl<T>
-
startWorker
private void startWorker()
-