T
- the input and output value typepublic final class DirectProcessor<T> extends FluxProcessor<T,T> implements Receiver, MultiProducer
This implementation signals an IllegalStateException if a Subscriber is not ready to receive a value due to not requesting enough.
The implementation ignores Subscriptions set via onSubscribe.
A terminated DirectProcessor will emit the terminal signal to late subscribers.
UNSPECIFIED
Modifier and Type | Method and Description |
---|---|
static <E> DirectProcessor<E> |
create()
Create a new
DirectProcessor |
long |
downstreamCount()
the number of downstream receivers
|
java.util.Iterator<?> |
downstreams()
the connected data receivers
|
java.lang.Throwable |
getError()
Current error if any, default to null
|
long |
getPrefetch()
The prefetch configuration of the
Flux |
boolean |
hasCompleted() |
boolean |
hasDownstreams()
Has any Subscriber attached to this multi-producer ?
|
boolean |
hasError() |
boolean |
isStarted()
Has this upstream started or "onSubscribed" ?
|
boolean |
isTerminated()
Has this upstream finished or "completed" / "failed" ?
|
void |
onComplete() |
void |
onError(java.lang.Throwable t) |
void |
onNext(T t) |
void |
onSubscribe(org.reactivestreams.Subscription s) |
static <T> FluxProcessor<T,T> |
serialize()
|
void |
subscribe(org.reactivestreams.Subscriber<? super T> s) |
java.lang.Object |
upstream()
Return the direct source of data, Supports reference.
|
connect, connectSink, connectSink, getCapacity, switchOnNext, wrap
all, any, as, awaitOnSubscribe, blockFirst, blockFirst, blockFirstMillis, blockLast, blockLast, blockLastMillis, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, cache, cache, cast, collect, collect, collectList, collectMap, collectMap, collectMap, collectMultimap, collectMultimap, collectMultimap, collectSortedList, collectSortedList, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, combineLatest, compose, concat, concat, concat, concat, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatMap, concatMap, concatMapDelayError, concatMapDelayError, concatMapDelayError, concatMapIterable, concatMapIterable, concatWith, count, create, create, defaultIfEmpty, defer, delay, delayMillis, delayMillis, delaySubscription, delaySubscription, delaySubscriptionMillis, delaySubscriptionMillis, dematerialize, distinct, distinct, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doOnCancel, doOnComplete, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elapsed, elementAt, elementAtOrDefault, empty, error, error, every, everyFirst, filter, firstEmitting, firstEmitting, firstEmittingWith, flatMap, flatMap, flatMap, flatMap, flatMap, flatMapIterable, flatMapIterable, from, fromArray, fromIterable, fromStream, generate, generate, generate, groupBy, groupBy, groupJoin, handle, hasElement, hasElements, hide, ignoreElements, interval, interval, intervalMillis, intervalMillis, intervalMillis, intervalMillis, join, just, just, last, log, log, log, map, mapError, mapError, mapError, materialize, merge, merge, merge, merge, merge, merge, mergeWith, never, next, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorResumeWith, onErrorResumeWith, onErrorResumeWith, onErrorReturn, onErrorReturn, onErrorReturn, onTerminateDetach, parallel, parallel, parallel, process, process, process, process, publish, publish, publish, publish, publishNext, publishOn, publishOn, range, reduce, reduce, reduceWith, repeat, repeat, repeat, repeat, repeatWhen, replay, replay, retry, retry, retry, retry, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleFirstMillis, sampleMillis, sampleTimeout, sampleTimeout, scan, scan, scanWith, single, singleOrDefault, singleOrEmpty, skip, skip, skipLast, skipMillis, skipMillis, skipUntil, skipUntilOther, skipWhile, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnError, switchOnError, switchOnError, switchOnNext, switchOnNext, take, take, takeLast, takeMillis, takeMillis, takeUntil, takeUntilOther, takeWhile, then, then, then, thenMany, thenMany, timeout, timeout, timeout, timeout, timeout, timeoutMillis, timeoutMillis, timeoutMillis, timeoutMillis, timestamp, toIterable, toIterable, toIterable, toStream, toStream, toString, transform, using, using, window, window, window, window, window, window, window, window, windowMillis, windowMillis, windowMillis, windowMillis, windowMillis, windowMillis, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWith, zipWith, zipWith, zipWith, zipWithIterable, zipWithIterable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
expectedFromUpstream, getPending, isCancelled, limit, requestedFromDownstream
public static <E> DirectProcessor<E> create()
DirectProcessor
E
- Type of processed signalspublic static <T> FluxProcessor<T,T> serialize()
FluxProcessor
from hot create()
safely gated by a serializing Subscriber
.
It will not propagate cancel upstream if Subscription
has been set. Serialization uses thread-stealing
and a potentially unbounded queue that might starve a calling thread if races are too important and
Subscriber
is slower.
T
- the relayed typeFluxProcessor
public long getPrefetch()
Flux
Flux
getPrefetch
in class Flux<T>
Flux
, -1L if unspecifiedpublic void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public void onError(java.lang.Throwable t)
onError
in interface org.reactivestreams.Subscriber<T>
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<T>
public void subscribe(org.reactivestreams.Subscriber<? super T> s)
subscribe
in interface org.reactivestreams.Publisher<T>
subscribe
in class FluxProcessor<T,T>
public boolean isStarted()
Trackable
public boolean isTerminated()
Trackable
isTerminated
in interface Trackable
public java.util.Iterator<?> downstreams()
MultiProducer
downstreams
in interface MultiProducer
public long downstreamCount()
MultiProducer
downstreamCount
in interface MultiProducer
public boolean hasDownstreams()
MultiProducer
hasDownstreams
in interface MultiProducer
public boolean hasCompleted()
public boolean hasError()
public java.lang.Throwable getError()
Trackable