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, wrap
all, 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, zipWithIterable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, addAll, contains, containsAll, element, iterator, offer, peek, remove, remove, removeAll, retainAll, toArray, toArray
equals, hashCode, parallelStream, removeIf, spliterator, stream
expectedFromUpstream, getPending, limit
public 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 typeFluxProcessor
public 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 queueFluxProcessor
public 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 signalFluxProcessor
public 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.FluxProcessor
public void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public long getPrefetch()
Flux
Flux
getPrefetch
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.Subscription
public void cancel()
cancel
in interface org.reactivestreams.Subscription
public 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.QueueSubscription
One 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 Trackable
public boolean isStarted()
Trackable
public boolean isTerminated()
Trackable
isTerminated
in interface Trackable
public java.lang.Throwable getError()
Trackable
public java.lang.Object downstream()
Producer
downstream
in interface Producer
public java.lang.Object upstream()
Receiver
public long getCapacity()
Trackable
getCapacity
in interface Trackable
getCapacity
in class FluxProcessor<T,T>
public long requestedFromDownstream()
Trackable
Subscription
request needs.
This is the maximum in-flight data allowed to transit to this elements.requestedFromDownstream
in interface Trackable