Class DirectProcessor<T>
- Type Parameters:
T- the input and output value type
- All Implemented Interfaces:
Processor<T,,T> Publisher<T>,Subscriber<T>,CorePublisher<T>,CoreSubscriber<T>,Disposable,Scannable
Note: DirectProcessor does not coordinate backpressure between its
Subscribers and the upstream, but consumes its upstream in an
unbounded manner.
In the case where a downstream Subscriber is not ready to receive items (hasn't
requested yet or enough), it will be terminated with an
IllegalStateException.
Hence in terms of interaction model, DirectProcessor only supports PUSH from the
source through the processor to the Subscribers.
Note: If there are no Subscribers, upstream items are dropped and only the terminal events are retained. A terminated DirectProcessor will emit the terminal signal to late subscribers.
Note: The implementation ignores Subscriptions set via onSubscribe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface reactor.core.Disposable
Disposable.Composite, Disposable.SwapNested classes/interfaces inherited from interface reactor.core.Scannable
Scannable.Attr<T> -
Field Summary
Fields inherited from interface reactor.core.Scannable
OPERATOR_NAME_UNRELATED_WORDS_PATTERN -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.static <E> DirectProcessor<E>create()Deprecated.To be removed in 3.5.Deprecated.Request aContextfrom dependent components which can include downstream operators during subscribing or a terminalSubscriber.longDeprecated.Return the number of activeSubscriberor -1 if untracked.getError()Deprecated.Current error if any, default to nullintDeprecated.The prefetch configuration of theFluxbooleanDeprecated.Return true if anySubscriberis actively subscribedinners()Deprecated.Return aStreamof referenced inners (flatmap, multicast etc)protected booleanDeprecated.Return true ifFluxProcessor<T, T>booleanDeprecated.Has this upstream finished or "completed" / "failed" ?voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.Implementors should initialize any state used bySubscriber.onNext(Object)before callingSubscription.request(long).voidDeprecated.voidsubscribe(CoreSubscriber<? super T> actual) Deprecated.An internalPublisher.subscribe(Subscriber)that will bypassHooks.onLastOperator(Function)pointcut.Methods inherited from class reactor.core.publisher.FluxProcessor
dispose, getBufferSize, hasCompleted, hasError, isSerialized, scanUnsafe, serialize, serializeAlways, sink, sink, switchOnNext, wrapMethods inherited from class reactor.core.publisher.Flux
all, any, as, blockFirst, blockFirst, blockLast, blockLast, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferTimeout, bufferUntil, bufferUntil, bufferUntilChanged, bufferUntilChanged, bufferUntilChanged, bufferWhen, bufferWhen, bufferWhile, cache, cache, 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, concat, concat, concat, concat, concatDelayError, concatDelayError, concatDelayError, concatDelayError, concatMap, concatMap, concatMapDelayError, concatMapDelayError, concatMapDelayError, concatMapIterable, concatMapIterable, concatWith, concatWithValues, contextCapture, contextWrite, contextWrite, count, create, create, defaultIfEmpty, defer, deferContextual, delayElements, delayElements, delaySequence, delaySequence, delaySubscription, delaySubscription, delaySubscription, delayUntil, dematerialize, distinct, distinct, distinct, distinct, distinctUntilChanged, distinctUntilChanged, distinctUntilChanged, doAfterTerminate, doFinally, doFirst, doOnCancel, doOnComplete, doOnDiscard, doOnEach, doOnError, doOnError, doOnError, doOnNext, doOnRequest, doOnSubscribe, doOnTerminate, elapsed, elapsed, elementAt, elementAt, empty, error, error, error, expand, expand, expandDeep, expandDeep, filter, filterWhen, filterWhen, first, first, firstWithSignal, firstWithSignal, firstWithValue, firstWithValue, 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, mapNotNull, materialize, merge, merge, merge, merge, merge, merge, mergeComparing, mergeComparing, mergeComparing, mergeComparingDelayError, mergeComparingWith, mergeDelayError, mergeOrdered, mergeOrdered, mergeOrdered, mergeOrderedWith, mergePriority, mergePriority, mergePriority, mergePriorityDelayError, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequential, mergeSequentialDelayError, mergeSequentialDelayError, mergeSequentialDelayError, mergeWith, metrics, name, never, next, ofType, onAssembly, onAssembly, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureBuffer, onBackpressureDrop, onBackpressureDrop, onBackpressureError, onBackpressureLatest, onErrorComplete, onErrorComplete, onErrorComplete, onErrorContinue, onErrorContinue, onErrorContinue, onErrorMap, onErrorMap, onErrorMap, onErrorResume, onErrorResume, onErrorResume, onErrorReturn, onErrorReturn, onErrorReturn, onErrorStop, 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, retryWhen, sample, sample, sampleFirst, sampleFirst, sampleTimeout, sampleTimeout, scan, scan, scanWith, share, shareNext, single, single, singleOrEmpty, skip, skip, skip, skipLast, skipUntil, skipUntilOther, skipWhile, sort, sort, startWith, startWith, startWith, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeOn, subscribeWith, switchIfEmpty, switchMap, switchMap, switchOnFirst, switchOnFirst, switchOnNext, switchOnNext, tag, take, take, take, take, takeLast, takeUntil, takeUntilOther, takeWhile, tap, tap, tap, then, then, thenEmpty, thenMany, timed, timed, timeout, timeout, timeout, timeout, timeout, timeout, timeout, timestamp, timestamp, toIterable, toIterable, toIterable, toStream, toStream, toString, transform, transformDeferred, transformDeferredContextual, using, using, using, using, usingWhen, usingWhen, window, window, window, window, window, window, window, windowTimeout, windowTimeout, windowTimeout, windowTimeout, windowUntil, windowUntil, windowUntil, windowUntilChanged, windowUntilChanged, windowUntilChanged, windowWhen, windowWhile, windowWhile, withLatestFrom, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zip, zipWith, zipWith, zipWith, zipWith, zipWithIterable, zipWithIterableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.Disposable
isDisposedMethods inherited from interface reactor.core.Scannable
actuals, isScanAvailable, name, parents, scan, scanOrDefault, stepName, steps, tags, tagsDeduplicated
-
Method Details
-
create
Deprecated.To be removed in 3.5. Closest sink isSinks.many().multicast().directBestEffort(), except it doesn't terminate overflowing downstreams.Create a newDirectProcessor- Type Parameters:
E- Type of processed signals- Returns:
- a fresh processor
-
getPrefetch
public int getPrefetch()Deprecated.Description copied from class:FluxThe prefetch configuration of theFlux- Overrides:
getPrefetchin classFlux<T>- Returns:
- the prefetch configuration of the
Flux, -1 if unspecified
-
currentContext
Deprecated.Description copied from interface:CoreSubscriberRequest aContextfrom dependent components which can include downstream operators during subscribing or a terminalSubscriber.- Specified by:
currentContextin interfaceCoreSubscriber<T>- Overrides:
currentContextin classFluxProcessor<T,T> - Returns:
- a resolved context or
Context.empty()
-
onSubscribe
Deprecated.Description copied from interface:CoreSubscriberImplementors should initialize any state used bySubscriber.onNext(Object)before callingSubscription.request(long). Should furtheronNextrelated state modification occur, thread-safety will be required.Note that an invalid request
<= 0will not produce an onError and will simply be ignored or reported through a debug-enabledLogger.- Specified by:
onSubscribein interfaceCoreSubscriber<T>- Specified by:
onSubscribein interfaceSubscriber<T>
-
onComplete
public void onComplete()Deprecated.- Specified by:
onCompletein interfaceSubscriber<T>
-
onError
Deprecated.- Specified by:
onErrorin interfaceSubscriber<T>
-
onNext
Deprecated.- Specified by:
onNextin interfaceSubscriber<T>
-
isIdentityProcessor
protected boolean isIdentityProcessor()Deprecated.Description copied from class:FluxProcessorReturn true ifFluxProcessor<T, T>- Overrides:
isIdentityProcessorin classFluxProcessor<T,T> - Returns:
- true if
FluxProcessor<T, T>
-
subscribe
Deprecated.Description copied from class:FluxAn internalPublisher.subscribe(Subscriber)that will bypassHooks.onLastOperator(Function)pointcut.In addition to behave as expected by
Publisher.subscribe(Subscriber)in a controlled manner, it supports direct subscribe-timeContextpassing.- Specified by:
subscribein interfaceCorePublisher<T>- Specified by:
subscribein classFlux<T>- Parameters:
actual- theSubscriberinterested into the published sequence- See Also:
-
inners
Deprecated.Description copied from interface:ScannableReturn aStreamof referenced inners (flatmap, multicast etc) -
isTerminated
public boolean isTerminated()Deprecated.Description copied from class:FluxProcessorHas this upstream finished or "completed" / "failed" ?- Overrides:
isTerminatedin classFluxProcessor<T,T> - Returns:
- has this upstream finished or "completed" / "failed" ?
-
downstreamCount
public long downstreamCount()Deprecated.Description copied from class:FluxProcessorReturn the number of activeSubscriberor -1 if untracked.- Overrides:
downstreamCountin classFluxProcessor<T,T> - Returns:
- the number of active
Subscriberor -1 if untracked
-
add
Deprecated. -
remove
Deprecated. -
hasDownstreams
public boolean hasDownstreams()Deprecated.Description copied from class:FluxProcessorReturn true if anySubscriberis actively subscribed- Overrides:
hasDownstreamsin classFluxProcessor<T,T> - Returns:
- true if any
Subscriberis actively subscribed
-
getError
Deprecated.Description copied from class:FluxProcessorCurrent error if any, default to null- Overrides:
getErrorin classFluxProcessor<T,T> - Returns:
- Current error if any, default to null
-
Sinks. Closest sink isSinks.many().multicast().directBestEffort(), except it doesn't terminate overflowing downstreams.