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(Queue<T> queue) |
UnicastProcessor(Queue<T> queue,
Consumer<? super T> onOverflow,
Disposable onTerminate) |
UnicastProcessor(Queue<T> queue,
Disposable 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(Queue<T> queue)
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
static <T> UnicastProcessor<T> |
create(Queue<T> queue,
Consumer<? super T> onOverflow,
Disposable endcallback)
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
static <T> UnicastProcessor<T> |
create(Queue<T> queue,
Disposable endcallback)
Create a unicast
FluxProcessor that will buffer on a given queue in an
unbounded fashion. |
Subscriber<? super T> |
downstream()
Return the direct data receiver.
|
long |
getCapacity()
Return defined element capacity
|
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(Throwable t) |
void |
onNext(T t) |
void |
onSubscribe(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(Subscriber<? super T> s) |
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, bufferTimeout, bufferTimeout, bufferTimeoutMillis, bufferTimeoutMillis, bufferTimeoutMillis, bufferUntil, bufferUntil, bufferWhile, cache, cache, cache, cache, cancelOn, cast, checkpoint, checkpoint, 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, delayElements, delayElementsMillis, delayElementsMillis, delayMillis, delayMillis, delaySubscription, delaySubscription, delaySubscriptionMillis, delaySubscriptionMillis, dematerialize, distinct, distinct, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doFinally, doOnCancel, doOnComplete, doOnEach, 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, flatMapSequential, flatMapSequential, flatMapSequential, flatMapSequential, from, fromArray, fromIterable, fromStream, generate, generate, generate, groupBy, groupBy, groupBy, groupBy, groupJoin, handle, hasElement, hasElements, hide, ignoreElements, interval, interval, intervalMillis, intervalMillis, intervalMillis, intervalMillis, join, just, just, last, last, limitRate, log, log, log, log, map, mapError, mapError, mapError, materialize, merge, merge, merge, merge, merge, merge, merge, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeWith, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorResumeWith, onErrorResumeWith, onErrorResumeWith, onErrorReturn, onErrorReturn, onErrorReturn, onTerminateDetach, parallel, parallel, parallel, publish, publish, publish, publish, publishNext, publishOn, 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, subscribe, subscribe, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnError, switchOnError, switchOnError, switchOnNext, switchOnNext, take, take, takeLast, takeMillis, takeMillis, takeUntil, takeUntilOther, takeWhile, then, then, then, thenEmpty, 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, windowTimeout, windowTimeoutMillis, windowTimeoutMillis, windowUntil, windowUntil, windowUntil, windowWhile, windowWhile, 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(Queue<T> queue, Disposable onTerminate)
public UnicastProcessor(Queue<T> queue, Consumer<? super T> onOverflow, Disposable 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(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(Queue<T> queue, Disposable 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(Queue<T> queue, Consumer<? super T> onOverflow, Disposable 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(Subscription s)
onSubscribe in interface Subscriber<T>public long getPrefetch()
FluxFluxgetPrefetch in class Flux<T>Flux, -1L if unspecifiedpublic void onNext(T t)
onNext in interface Subscriber<T>public void onError(Throwable t)
onError in interface Subscriber<T>public void onComplete()
onComplete in interface Subscriber<T>public void subscribe(Subscriber<? super T> s)
public void request(long n)
request in interface Subscriptionpublic void cancel()
cancel in interface Subscriptionpublic int size()
size in interface Collection<T>public boolean isEmpty()
isEmpty in interface Collection<T>public void clear()
clear in interface 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 Throwable getError()
Trackablepublic Subscriber<? super T> downstream()
Producerdownstream in interface Producerpublic 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