| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static enum |
| Modifier and Type | Field and Description |
|---|---|
| protected final AtomicReference | |
| private final Function | |
| protected final AtomicReference | |
| protected final AtomicReference | |
| protected final AtomicReference | |
| protected final PromiseFactory | |
| protected final PushStreamProvider |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PushStream | adjustBackPressure(LongUnaryOperator adjustment)
Implements org. Changes the back-pressure propagated by this pipeline stage. |
| public PushStream | adjustBackPressure(ToLongBiFunction<T, Long> adjustment)
Implements org. Changes the back-pressure propagated by this pipeline stage. |
| private <R> long | aggregateAndForward(Function<Collection<T>, R> f, AbstractPushStreamImpl<R> eventStream, PushEvent<? extends T> event, Queue<T> queue)
|
| private <R> void | aggregateAndForward(BiFunction<Long, Collection<T>, R> f, AbstractPushStreamImpl<R> eventStream, PushEvent<? extends T> event, Queue<T> queue, Executor executor, long elapsed)
|
| public Promise | allMatch(Predicate<? super T> predicate)
Implements org. Closes the channel and resolve the promise with false when the predicate does not matches a pay load. |
| public Promise | anyMatch(Predicate<? super T> predicate)
Implements org. Close the channel and resolve the promise with true when the predicate matches a payload. |
| public <R> PushStream | asyncMap(int
number of simultaneous promises to use n, int Nr of ms/promise that is queued back pressure delay, Function<? super T, Promise<? extends R>> The mapping function mapper)Implements org. Asynchronously map the payload values. |
| protected abstract boolean | |
| public PushStream | buffer()
Implements org. Buffer the events in a queue using default values for the queue size and other behaviors. |
| public <U extends BlockingQueue | buildBuffer()
Implements org. Build a buffer to enqueue events in a queue using custom values for the queue size and other behaviors. |
| pack-priv void | |
| public void | close()
Implements org. Close this PushStream by sending an event of type
|
| protected boolean | |
| protected boolean | |
| public <R> PushStream | coalesce(Function<? super T, Optional<R>> accumulator)
Implements org. Coalesces a number of events into a new type of event. |
| public <R> PushStream | coalesce(int count, Function<Collection<T>, R> f)
Implements org. Coalesces a number of events into a new type of event. |
| public <R> PushStream | coalesce(IntSupplier count, Function<Collection<T>, R> f)
Implements org. Coalesces a number of events into a new type of event. |
| public <R, A> Promise | collect(Collector<? super T, A, R> collector)
Implements org. See Stream. |
| public Promise | |
| public PushStream | |
| public PushStream | filter(Predicate<? super T>
The predicate that is tested (not null) predicate)Implements org. Only pass events downstream when the predicate tests true. |
| public Promise | findAny()
Implements org. Close the channel and resolve the promise with the first element. |
| public Promise | findFirst()
Implements org. Close the channel and resolve the promise with the first element. |
| public <R> PushStream | flatMap(Function<? super T, ? extends PushStream<? extends R>>
The flat map function mapper)Implements org. Flat map the payload value (turn one event into 0..n events of potentially another type). |
| public Promise | forEach(Consumer<? super T>
The action to perform action)Implements org. Execute the action for each event received until the channel is closed. |
| public Promise | forEachEvent(PushEventConsumer<? super T> action)
Implements org. Pass on each event to another consumer until the stream is closed. |
| public PushStream | fork(int
number of simultaneous background threads to use n, int Nr of ms/thread that is queued back pressure delay, Executor an executor to use for the background threads. ex)Implements org. Execute the downstream events in up to n background threads. |
| protected Queue | |
| private <R> Runnable | getWindowTask(AbstractPushStreamImpl<R> eventStream, BiFunction<Long, Collection<T>, R> f, Supplier<Duration> time, IntSupplier maxEvents, Object lock, long expectedCounter, AtomicReference<Queue<T>> queueRef, AtomicLong timestamp, AtomicLong counter, AtomicLong previousWindowSize, Executor executor)
|
| protected long | |
| public PushStream | limit(long
Maximum number of elements has been received maxSize)Implements org. Automatically close the channel after the maxSize number of elements is received. |
| public PushStream | limit(Duration
The maximum time that the stream should remain open maxTime)Implements org. Automatically close the channel after the given amount of time has elapsed. |
| public <R> PushStream | map(Function<? super T, ? extends R>
The map function mapper)Implements org. Map a payload value. |
| public Promise | max(Comparator<? super T> comparator)
Implements org. See Stream. |
| public PushStream | merge(PushEventSource<? extends T>
The source to merge in. source)Implements org. Merge in the events from another source. |
| public PushStream | merge(PushStream<? extends T>
The source to merge in. source)Implements org. Merge in the events from another PushStream. |
| public Promise | min(Comparator<? super T> comparator)
Implements org. See Stream. |
| public Promise | noneMatch(Predicate<? super T> predicate)
Implements org. Closes the channel and resolve the promise with false when the predicate matches any pay load. |
| public PushStream | onClose(Runnable
Will be called on close closeHandler)Implements org. Provide a handler that must be run after the PushStream is closed. |
| public PushStream | onError(Consumer<? super Throwable>
Will be called on an error event closeHandler)Implements org. Provide a handler that will be called if the PushStream is closed with an
event of type |
| public Promise | reduce(T
The identity/begin value identity, BinaryOperator<T> The accumulator accumulator)Implements org. Standard reduce, see Stream. |
| public Promise | reduce(BinaryOperator<T>
The accumulator accumulator)Implements org. Standard reduce without identity, so the return is an Optional. |
| public <U> Promise | reduce(U identity, BiFunction<U, ? super T, U> accumulator, BinaryOperator<U>
combines two U's into one U (for example, combine two
lists) combiner)Implements org. Standard reduce with identity, accumulator and combiner. |
| public PushStream | sequential()
Implements org. Ensure that any events are delivered sequentially. |
| public PushStream | skip(long
number of elements to skip n)Implements org. Skip a number of events in the channel. |
| public PushStream | sorted()
Implements org. Sorted the elements, assuming that T extends Comparable. |
| public PushStream | sorted(Comparator<? super T> comparator)
Implements org. Sorted the elements with the given comparator. |
| public PushStream | split(Predicate<? super T>...
the predicates to test predicates)Implements org. Split the events to different streams based on a predicate. |
| public PushStream | timeout(Duration
The length of time that the stream should remain open
when no events are being received. maxTime)Implements org. Automatically fail the channel if no events are received for the indicated length of time. |
| public Promise | toArray()
Implements org. Collect the payloads in an Object array after the channel is closed. |
| public <A> Promise | toArray(IntFunction<A[]>
A function which returns an array into which the
payloads are stored. generator)Implements org. Collect the payloads in an Object array after the channel is closed. |
| private void | |
| protected abstract void | |
| public <R> PushStream | window(Duration time, Function<Collection<T>, R> f)
Implements org. Buffers a number of events over a fixed time interval and then forwards the events to an accumulator function. |
| public <R> PushStream | window(Duration time, Executor executor, Function<Collection<T>, R> f)
Implements org. Buffers a number of events over a fixed time interval and then forwards the events to an accumulator function. |
| public <R> PushStream | window(Supplier<Duration> time, IntSupplier maxEvents, BiFunction<Long, Collection<T>, R> f)
Implements org. Buffers a number of events over a variable time interval and then forwards the events to an accumulator function. |
| public <R> PushStream | window(Supplier<Duration> time, IntSupplier maxEvents, Executor ex, BiFunction<Long, Collection<T>, R> f)
Implements org. Buffers a number of events over a variable time interval and then forwards the events to an accumulator function. |