T - the input and output value typepublic final class EmitterProcessor<T> extends FluxProcessor<T,T>
The default create() factories will only produce the new elements observed in
the parent sequence after a given Subscriber is subscribed.
Scannable.Attr<T>Disposable.Composite, Disposable.Swap| Modifier and Type | Method and Description |
|---|---|
static <E> EmitterProcessor<E> |
create()
Create a new
EmitterProcessor using Queues.SMALL_BUFFER_SIZE
backlog size and auto-cancel. |
static <E> EmitterProcessor<E> |
create(boolean autoCancel)
Create a new
EmitterProcessor using Queues.SMALL_BUFFER_SIZE
backlog size and the provided auto-cancel. |
static <E> EmitterProcessor<E> |
create(int bufferSize)
Create a new
EmitterProcessor using the provided backlog size, with auto-cancel. |
static <E> EmitterProcessor<E> |
create(int bufferSize,
boolean autoCancel)
Create a new
EmitterProcessor using the provided backlog size and auto-cancellation. |
long |
downstreamCount()
Return the number of active
Subscriber or -1 if untracked. |
int |
getBufferSize()
Return the processor buffer capacity if any or
Integer.MAX_VALUE |
Throwable |
getError()
Current error if any, default to null
|
int |
getPending()
Return the number of parked elements in the emitter backlog.
|
int |
getPrefetch()
The prefetch configuration of the
Flux |
Stream<? extends Scannable> |
inners()
Return a
Stream of referenced inners (flatmap, multicast etc) |
boolean |
isCancelled() |
boolean |
isTerminated()
Has this upstream finished or "completed" / "failed" ?
|
void |
onComplete() |
void |
onError(Throwable t) |
void |
onNext(T t) |
void |
onSubscribe(Subscription s)
Implementors should initialize any state used by
Subscriber.onNext(Object) before
calling Subscription.request(long). |
Object |
scanUnsafe(Scannable.Attr key)
This method is used internally by components to define their key-value mappings
in a single place.
|
void |
subscribe(CoreSubscriber<? super T> actual)
An internal
Publisher.subscribe(Subscriber) that will bypass
Hooks.onLastOperator(Function) pointcut. |
dispose, hasCompleted, hasDownstreams, hasError, isSerialized, serialize, serializeAlways, sink, sink, switchOnNext, wrapall, any, as, blockFirst, blockFirst, blockLast, blockLast, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferUntil, bufferUntil, bufferWhen, bufferWhen, bufferWhile, cache, cache, cache, cache, cancelOn, cast, checkpoint, 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, concatWithValues, count, create, create, defaultIfEmpty, defer, delayElements, delayElements, delaySequence, delaySequence, delaySubscription, delaySubscription, delaySubscription, delayUntil, dematerialize, distinct, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doFinally, doOnCancel, doOnComplete, doOnEach, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elapsed, elapsed, elementAt, elementAt, empty, error, error, expand, expand, expandDeep, expandDeep, filter, filterWhen, filterWhen, first, first, flatMap, flatMap, flatMap, flatMap, flatMapDelayError, flatMapIterable, flatMapIterable, flatMapSequential, flatMapSequential, flatMapSequential, flatMapSequentialDelayError, from, fromArray, fromIterable, fromStream, fromStream, generate, generate, generate, groupBy, groupBy, groupBy, groupBy, groupJoin, handle, hasElement, hasElements, hide, ignoreElements, index, index, interval, interval, interval, interval, join, just, just, last, last, limitRate, limitRate, limitRequest, log, log, log, log, log, log, map, materialize, merge, merge, merge, merge, merge, merge, mergeDelayError, mergeOrdered, mergeOrdered, mergeOrdered, mergeOrderedWith, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequentialDelayError, mergeSequentialDelayError, mergeSequentialDelayError, mergeWith, name, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorMap, onErrorMap, onErrorMap, onErrorResume, onErrorResume, onErrorResume, onErrorReturn, onErrorReturn, onErrorReturn, onLastAssembly, onTerminateDetach, or, parallel, parallel, parallel, publish, publish, publish, publish, publishNext, publishOn, publishOn, publishOn, push, push, range, reduce, reduce, reduceWith, repeat, repeat, repeat, repeat, repeatWhen, replay, replay, replay, replay, replay, replay, retry, retry, retry, retry, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleTimeout, sampleTimeout, scan, scan, scanWith, share, single, single, singleOrEmpty, skip, skip, skip, skipLast, skipUntil, skipUntilOther, skipWhile, sort, sort, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeOn, subscriberContext, subscriberContext, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnNext, switchOnNext, tag, take, take, take, takeLast, takeUntil, takeUntilOther, takeWhile, then, then, thenEmpty, thenMany, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timestamp, timestamp, toIterable, toIterable, toIterable, toStream, toStream, toString, transform, using, using, window, window, window, window, window, window, window, windowTimeout, windowTimeout, windowUntil, windowUntil, windowUntil, windowWhen, windowWhile, windowWhile, withLatestFrom, 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, waitcurrentContextactuals, from, isScanAvailable, name, operatorName, parents, scan, scanOrDefault, tagsisDisposedpublic static <E> EmitterProcessor<E> create()
EmitterProcessor using Queues.SMALL_BUFFER_SIZE
backlog size and auto-cancel.E - Type of processed signalspublic static <E> EmitterProcessor<E> create(boolean autoCancel)
EmitterProcessor using Queues.SMALL_BUFFER_SIZE
backlog size and the provided auto-cancel.E - Type of processed signalsautoCancel - automatically cancelpublic static <E> EmitterProcessor<E> create(int bufferSize)
EmitterProcessor using the provided backlog size, with auto-cancel.E - Type of processed signalsbufferSize - the internal buffer size to hold signalspublic static <E> EmitterProcessor<E> create(int bufferSize, boolean autoCancel)
EmitterProcessor using the provided backlog size and auto-cancellation.E - Type of processed signalsbufferSize - the internal buffer size to hold signalsautoCancel - automatically cancelpublic Stream<? extends Scannable> inners()
ScannableStream of referenced inners (flatmap, multicast etc)public void subscribe(CoreSubscriber<? super T> actual)
FluxPublisher.subscribe(Subscriber) that will bypass
Hooks.onLastOperator(Function) pointcut.
In addition to behave as expected by Publisher.subscribe(Subscriber)
in a controlled manner, it supports direct subscribe-time Context passing.
subscribe in class Flux<T>actual - the Subscriber interested into the published sequenceFlux.subscribe(Subscriber)public int getPending()
public void onSubscribe(Subscription s)
CoreSubscriberSubscriber.onNext(Object) before
calling Subscription.request(long). Should further onNext related
state modification occur, thread-safety will be required.
Note that an invalid request <= 0 will not produce an onError and
will simply be ignored or reported through a debug-enabled
Logger.
public void onNext(T t)
public void onError(Throwable t)
public void onComplete()
@Nullable public Throwable getError()
FluxProcessorgetError in class FluxProcessor<T,T>public boolean isCancelled()
public final int getBufferSize()
FluxProcessorInteger.MAX_VALUEgetBufferSize in class FluxProcessor<T,T>Integer.MAX_VALUEpublic boolean isTerminated()
FluxProcessorisTerminated in class FluxProcessor<T,T>public int getPrefetch()
FluxFluxgetPrefetch in class Flux<T>Flux, -1 if unspecified@Nullable public Object scanUnsafe(Scannable.Attr key)
ScannableScannable.Attr key,
implementors should take care to return values of the correct type, and return
null if no specific value is available.
For public consumption of attributes, prefer using Scannable.scan(Attr), which will
return a typed value and fall back to the key's default if the component didn't
define any mapping.
scanUnsafe in interface ScannablescanUnsafe in class FluxProcessor<T,T>key - a Scannable.Attr to resolve for the component.public long downstreamCount()
FluxProcessorSubscriber or -1 if untracked.downstreamCount in class FluxProcessor<T,T>Subscriber or -1 if untracked