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 Uprivate final intprivate final PushbackPolicy<T, U> private final QueuePolicy<T, U> private final Semaphoreprivate final AtomicBooleanIndicates 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, upstreamFields 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 longhandleEvent(PushEvent<? extends T> event) private voidMethods inherited from class org.osgi.util.pushstream.UnbufferedPushStreamImpl
begin, close, upstreamCloseMethods 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, windowMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
handleEventin classAbstractPushStreamImpl<T>
-
startWorker
private void startWorker()
-