T - the input and output typepublic final class UnicastProcessor<T> extends FluxProcessor<T,T> implements Fuseable.QueueSubscription<T>, Fuseable, Producer, Receiver
The implementation keeps the order of signals.
Fuseable.ConditionalSubscriber<T>, Fuseable.QueueSubscription<T>, Fuseable.ScalarCallable<T>, Fuseable.SynchronousSubscription<T>UNSPECIFIED| Constructor and Description |
|---|
UnicastProcessor(java.util.Queue<T> queue) |
UnicastProcessor(java.util.Queue<T> queue,
Cancellation onTerminate) |
UnicastProcessor(java.util.Queue<T> queue,
java.util.function.Consumer<? super T> onOverflow,
Cancellation onTerminate) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
clear() |
static <T> UnicastProcessor<T> |
create()
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
static <T> UnicastProcessor<T> |
create(java.util.Queue<T> queue)
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
static <T> UnicastProcessor<T> |
create(java.util.Queue<T> queue,
Cancellation endcallback)
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
static <T> UnicastProcessor<T> |
create(java.util.Queue<T> queue,
java.util.function.Consumer<? super T> onOverflow,
Cancellation endcallback)
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
java.lang.Object |
downstream()
Return the direct data receiver.
|
long |
getCapacity()
Return defined element capacity
|
java.lang.Throwable |
getError()
Current error if any, default to null
|
long |
getPrefetch()
The prefetch configuration of the
Flux |
boolean |
isCancelled() |
boolean |
isEmpty() |
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) |
T |
poll() |
void |
request(long n) |
long |
requestedFromDownstream()
Return defined element capacity, used to drive new
Subscription request needs. |
int |
requestFusion(int requestedMode)
Request a specific fusion mode from this QueueSubscription.
|
int |
size() |
void |
subscribe(org.reactivestreams.Subscriber<? super T> s) |
java.lang.Object |
upstream()
Return the direct source of data, Supports reference.
|
connect, connectSink, connectSink, serialize, switchOnNext, wrapall, any, as, awaitOnSubscribe, blockFirst, blockFirst, blockFirstMillis, blockLast, blockLast, blockLastMillis, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, bufferMillis, cache, cache, cache, cache, cancelOn, 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, elapsed, elementAt, elementAt, empty, error, error, 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, last, log, log, log, log, map, mapError, mapError, mapError, materialize, merge, merge, merge, merge, merge, merge, mergeWith, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorResumeWith, onErrorResumeWith, onErrorResumeWith, onErrorReturn, onErrorReturn, onErrorReturn, onTerminateDetach, parallel, parallel, parallel, publish, publish, publish, publish, publishNext, publishOn, publishOn, range, reduce, reduce, reduceWith, repeat, repeat, repeat, repeat, repeatWhen, replay, replay, replay, replay, replayMillis, replayMillis, retry, retry, retry, retry, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleFirstMillis, sampleMillis, sampleTimeout, sampleTimeout, scan, scan, scanWith, share, single, single, singleOrEmpty, skip, skip, skipLast, skipMillis, skipMillis, skipUntil, skipUntilOther, skipWhile, sort, sort, 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, timestamp, toIterable, toIterable, toIterable, toStream, toStream, toString, transform, using, using, window, window, window, window, window, window, window, window, windowMillis, windowMillis, windowMillis, windowMillis, windowMillis, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWith, zipWith, zipWith, zipWith, zipWithIterable, zipWithIterableclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addAll, contains, containsAll, element, iterator, offer, peek, remove, remove, removeAll, retainAll, toArray, toArrayequals, hashCode, parallelStream, removeIf, spliterator, streamexpectedFromUpstream, getPending, limitpublic UnicastProcessor(java.util.Queue<T> queue)
public UnicastProcessor(java.util.Queue<T> queue, Cancellation onTerminate)
public UnicastProcessor(java.util.Queue<T> queue, java.util.function.Consumer<? super T> onOverflow, Cancellation onTerminate)
public static <T> UnicastProcessor<T> create()
FluxProcessor that will buffer on a given queue in an
unbounded fashion.T - the relayed typeFluxProcessorpublic static <T> UnicastProcessor<T> create(java.util.Queue<T> queue)
FluxProcessor that will buffer on a given queue in an
unbounded fashion.T - the relayed typequeue - the buffering queueFluxProcessorpublic static <T> UnicastProcessor<T> create(java.util.Queue<T> queue, Cancellation endcallback)
FluxProcessor that will buffer on a given queue in an
unbounded fashion.T - the relayed typequeue - the buffering queueendcallback - called on any terminal signalFluxProcessorpublic static <T> UnicastProcessor<T> create(java.util.Queue<T> queue, java.util.function.Consumer<? super T> onOverflow, Cancellation endcallback)
FluxProcessor that will buffer on a given queue in an
unbounded fashion.T - the relayed typequeue - the buffering queueendcallback - called on any terminal signalonOverflow - called when queue.offer return false and unicastProcessor is
about to emit onError.FluxProcessorpublic void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe in interface org.reactivestreams.Subscriber<T>public long getPrefetch()
FluxFluxgetPrefetch in class Flux<T>Flux, -1L if unspecifiedpublic 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 void request(long n)
request in interface org.reactivestreams.Subscriptionpublic void cancel()
cancel in interface org.reactivestreams.Subscriptionpublic int size()
size in interface java.util.Collection<T>public boolean isEmpty()
isEmpty in interface java.util.Collection<T>public void clear()
clear in interface java.util.Collection<T>public int requestFusion(int requestedMode)
Fuseable.QueueSubscriptionOne should request either SYNC, ASYNC or ANY modes (never NONE) and the implementor should return NONE, SYNC or ASYNC (never ANY).
For example, if a source supports only ASYNC fusion but the intermediate operator supports only SYNC fuseable sources, the operator may request SYNC fusion and the source can reject it via NONE, thus the operator can return NONE as well to dowstream and the fusion doesn't happen.
requestFusion in interface Fuseable.QueueSubscription<T>requestedMode - the mode to requestpublic boolean isCancelled()
isCancelled in interface Trackablepublic boolean isStarted()
Trackablepublic boolean isTerminated()
TrackableisTerminated in interface Trackablepublic java.lang.Throwable getError()
Trackablepublic java.lang.Object downstream()
Producerdownstream in interface Producerpublic java.lang.Object upstream()
Receiverpublic long getCapacity()
TrackablegetCapacity in interface TrackablegetCapacity in class FluxProcessor<T,T>public long requestedFromDownstream()
TrackableSubscription request needs.
This is the maximum in-flight data allowed to transit to this elements.requestedFromDownstream in interface Trackable