Top Description Inners Fields Constructors Methods
reactor.core.publisher

pack-priv final Class FluxUsingWhen<T, S>

extends Flux<T>
implements SourceProducer<T>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.SourceProducer, org.reactivestreams.Publisher, reactor.core.Scannable
Type Parameters
<T>
the value type streamed
<S>
the resource type
Imports
java.util.Objects, java.util.concurrent.Callable, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, .AtomicReferenceFieldUpdater, java.util.function.BiFunction, .Function, org.reactivestreams.Publisher, .Subscriber, .Subscription, reactor.core.CoreSubscriber, .Exceptions, .Fuseable.ConditionalSubscriber, reactor.core.publisher.Operators.DeferredSubscription, reactor.util.Loggers, reactor.util.annotation.Nullable, reactor.util.context.Context

Uses a resource that is lazily generated by a Publisher for each individualSubscriber, while streaming the values from a Publisher derived from the same resource. Whenever the resulting sequence terminates, the relevant Function generates a "cleanup" Publisher that is invoked but doesn't change the content of the main sequence. Instead it just defers the termination (unless it errors, in which case the error suppresses the original termination signal).

Note that if the resource supplying Publisher emits more than one resource, the subsequent resources are dropped (Operators#onNextDropped(Object, Context)). If the publisher errors AFTER having emitted one resource, the error is also silently dropped (Operators#onErrorDropped(Throwable, Context)).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
FluxUsingWhen.CancelInner

Used in the cancel path to still give the generated Publisher access to the Context

pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
private static interface
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final Function<? super S, ? extends Publisher<?>>
pack-priv final Function<? super S, ? extends Publisher<?>>
pack-priv final BiFunction<? super S, ? super Throwable, ? extends Publisher<?>>
pack-priv final Function<? super S, ? extends Publisher<? extends T>>
pack-priv final Publisher<S>
Inherited from reactor.core.publisher.Flux:
ALWAYS_BOOLEAN_SUPPLIERIDENTITY_FUNCTIONLIST_SUPPLIEROBJECT_EQUALSET_SUPPLIERTUPLE2_BIFUNCTION

Constructor Summary

AccessConstructor and Description
pack-priv
FluxUsingWhen(Publisher<S> resourceSupplier, Function<? super S, ? extends Publisher<? extends T>> resourceClosure, Function<? super S, ? extends Publisher<?>> asyncComplete, BiFunction<? super S, ? super Throwable, ? extends Publisher<?>> asyncError, Function<? super S, ? extends Publisher<?>> asyncCancel)

Method Summary

Modifier and TypeMethod and Description
private static <RESOURCE, T> Publisher<? extends T>
deriveFluxFromResource(RESOURCE resource, Function<? super RESOURCE, ? extends Publisher<? extends T>> resourceClosure)

private static <RESOURCE, T> FluxUsingWhen.UsingWhenSubscriber<? super T, RESOURCE>
prepareSubscriberForResource(RESOURCE resource, CoreSubscriber<? super T> actual, Function<? super RESOURCE, ? extends Publisher<?>> asyncComplete, BiFunction<? super RESOURCE, ? super Throwable, ? extends Publisher<?>> asyncError, Function<? super RESOURCE, ? extends Publisher<?>> asyncCancel, Operators.DeferredSubscription arbiter)

public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Overrides default reactor.core.publisher.SourceProducer.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
public void
subscribe(CoreSubscriber<? super T>
the Subscriber interested into the published sequence
actual
)

Implements abstract reactor.core.publisher.Flux.subscribe.

Implements reactor.core.CorePublisher.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.
Inherited from reactor.core.publisher.Flux:
allanyasblockFirstblockFirstblockLastblockLastbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferUntilbufferUntilbufferUntilChangedbufferUntilChangedbufferUntilChangedbufferWhenbufferWhenbufferWhilecachecachecachecachecachecachecancelOncastcheckpointcheckpointcheckpointcollectcollectcollectListcollectMapcollectMapcollectMapcollectMultimapcollectMultimapcollectMultimapcollectSortedListcollectSortedListcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestconcatconcatconcatconcatconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatMapconcatMapconcatMapDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapIterableconcatMapIterableconcatWithconcatWithValuescontextCapturecontextWritecontextWritecountcountingBooleanSuppliercountingPredicatecreatecreatedefaultIfEmptydeferdeferContextualdelayElementsdelayElementsdelaySequencedelaySequencedelaySubscriptiondelaySubscriptiondelaySubscriptiondelayUntildematerializedistinctdistinctdistinctdistinctdistinctUntilChangeddistinctUntilChangeddistinctUntilChangeddoAfterTerminatedoFinallydoFirstdoOnCanceldoOnCompletedoOnDiscarddoOnEachdoOnErrordoOnErrordoOnErrordoOnNextdoOnRequestdoOnSignaldoOnSubscribedoOnTerminateelapsedelapsedelementAtelementAtemptyequalPredicateerrorerrorerrorexpandexpandexpandDeepexpandDeepfilterfilterWhenfilterWhenfirstfirstfirstWithSignalfirstWithSignalfirstWithValuefirstWithValueflatMapflatMapflatMapflatMapflatMapflatMapDelayErrorflatMapIterableflatMapIterableflatMapSequentialflatMapSequentialflatMapSequentialflatMapSequentialflatMapSequentialDelayErrorfromfromArrayfromIterablefromStreamfromStreamgenerategenerategenerategetPrefetchgroupBygroupBygroupBygroupBygroupJoinhandlehasElementhasElementshashSetSupplierhideidentityFunctionignoreElementsindexindexintervalintervalintervalintervaljoinjustjustlastlastlimitRatelimitRatelimitRequestlistSupplierloglogloglogloglogmapmapNotNullmaterializemergemergemergemergemergemergemergemergeComparingmergeComparingmergeComparingmergeComparingDelayErrormergeComparingWithmergeDelayErrormergeOrderedmergeOrderedmergeOrderedmergeOrderedWithmergePrioritymergePrioritymergePrioritymergePriorityDelayErrormergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialDelayErrormergeSequentialDelayErrormergeSequentialDelayErrormergeWithmetricsnamenevernextofTypeonAssemblyonAssemblyonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureDroponBackpressureDroponBackpressureErroronBackpressureLatestonErrorCompleteonErrorCompleteonErrorCompleteonErrorContinueonErrorContinueonErrorContinueonErrorMaponErrorMaponErrorMaponErrorResumeonErrorResumeonErrorResumeonErrorReturnonErrorReturnonErrorReturnonErrorStoponTerminateDetachorparallelparallelparallelpublishpublishpublishpublishpublishNextpublishOnpublishOnpublishOnpublishOnpushpushrangereducereducereduceWithrepeatrepeatrepeatrepeatrepeatWhenreplayreplayreplayreplayreplayreplayretryretryretryWhensamplesamplesampleFirstsampleFirstsampleTimeoutsampleTimeoutscanscanscanWithshareshareNextsinglesinglesingleOrEmptyskipskipskipskipLastskipUntilskipUntilOtherskipWhilesortsortstartWithstartWithstartWithsubscribesubscribesubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeOnsubscribeWithswitchIfEmptyswitchMapswitchMapswitchOnFirstswitchOnFirstswitchOnNextswitchOnNexttagtaketaketaketaketakeLasttakeUntiltakeUntilOthertakeWhiletaptaptapthenthenthenEmptythenManytimedtimedtimeouttimeouttimeouttimeouttimeouttimeouttimeouttimestamptimestamptoIterabletoIterabletoIterabletoStreamtoStreamtoStringtransformtransformDeferredtransformDeferredContextualtuple2FunctionusingusingusingWhenusingWhenwindowwindowwindowwindowwindowwindowwindowwindowTimeoutwindowTimeoutwindowTimeoutwindowTimeoutwindowUntilwindowUntilwindowUntilwindowUntilChangedwindowUntilChangedwindowUntilChangedwindowWhenwindowWhilewindowWhilewithLatestFromwrapwrapToMonozipzipzipzipzipzipzipzipzipzipzipzipzipzipWithzipWithzipWithzipWithzipWithIterablezipWithIterable