Top Description Inners Fields Constructors Methods
reactor.core.publisher

pack-priv final Class FluxSwitchMapNoPrefetch<T, R>

extends InternalFluxOperator<T, R>
Class Inheritance
Type Parameters
<T>
the source value type
<R>
the output value type
Imports
java.util.Objects, .StringJoiner, java.util.concurrent.atomic.AtomicLongFieldUpdater, .AtomicReferenceFieldUpdater, java.util.function.Function, java.util.stream.Stream, org.reactivestreams.Publisher, .Subscription, reactor.core.CoreSubscriber, .Exceptions, .Scannable, reactor.util.annotation.Nullable, reactor.util.context.Context

Switches to a new Publisher generated via a function whenever the upstream produces an item.
See Also
Reactive-Streams-Commons

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static long
pack-priv static long
pack-priv static int
pack-priv static int
pack-priv static long
pack-priv static long
pack-priv static long
pack-priv final Function<? super T, ? extends Publisher<? extends R>>
pack-priv static int
pack-priv static long
Inherited from reactor.core.publisher.InternalFluxOperator:
optimizableOperator

Constructor Summary

AccessConstructor and Description
pack-priv
FluxSwitchMapNoPrefetch(Flux<? extends T> source, Function<? super T, ? extends Publisher<? extends R>> mapper)

Method Summary

Modifier and TypeMethod and Description
pack-priv static long

Returns:

next state
addRequest
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, long
received from Operators#addCap method.
previousRequested
)

Atomically add increment hasRequest value to indicate that we added capacity to SwitchMapMain#requested

Note, If the given previousRequested param value is greater than zero it works as an indicator that in some scenarios prevents setting HasRequest to 1.

public int
getPrefetch()

Overrides reactor.core.publisher.Flux.getPrefetch.

The prefetch configuration of the Flux
pack-priv static boolean
hasInnerCompleted(long state)

pack-priv static boolean
hasMainCompleted(long state)

pack-priv static int
hasRequest(long state)

pack-priv static long

Returns:

previous state
incrementIndex
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically increment the index of the active inner subscriber.

pack-priv static int
index(long state)

pack-priv static boolean
isInnerSubscribed(long state)

pack-priv static boolean
isWip(long state)

pack-priv static int
nextIndex(long state)

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

Overrides reactor.core.publisher.InternalFluxOperator.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
pack-priv static long

Returns:

previous state
setInnerCompleted
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically set the inner completed flag.

pack-priv static long

Returns:

previous state
setInnerSubscribed
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, int expectedIndex)

Atomically set a bit on the current state indicating that current inner has received a subscription.

pack-priv static long

Returns:

previous state
setMainCompleted
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically set main completed flag.

pack-priv static long

Returns:

previous state
setTerminated
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically set state as terminated

pack-priv static long

Returns:

previous state
setWip
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, int expectedIndex)

Atomically set WIP flag to indicate that we do some work from Inner#OnNext or Inner#OnComplete.

pack-priv static long

Returns:

encoded state
state
(int index, boolean wip, int hasRequest, boolean innerSubscribed, boolean mainCompleted, boolean innerCompleted)

Generic method to encode state from the given params into a long value

public CoreSubscriber<? super T>
subscribeOrReturn(CoreSubscriber<? super R> actual)

Implements abstract reactor.core.publisher.InternalFluxOperator.subscribeOrReturn.

Implements reactor.core.publisher.OptimizableOperator.subscribeOrReturn.

Allow delegation of the subscription by returning a CoreSubscriber, or force subscription encapsulation by returning null.
pack-priv static long

Returns:

previous state
unsetWip
(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, int expectedIndex, boolean isDemandFulfilled, int expectedRequest)

Atomically unset WIP flag to indicate that we have done the work from Inner#OnNext If the current state is TERMINATED or the index is one equals to expected then the flag will not be set

Inherited from reactor.core.publisher.InternalFluxOperator:
nextOptimizableSourcesourcesubscribe

Field Detail

COMPLETED_MASKback to summary
pack-priv static long COMPLETED_MASK
HAS_REQUEST_MASKback to summary
pack-priv static long HAS_REQUEST_MASK
HAS_REQUEST_OFFSETback to summary
pack-priv static int HAS_REQUEST_OFFSET
INDEX_OFFSETback to summary
pack-priv static int INDEX_OFFSET
INNER_COMPLETED_MASKback to summary
pack-priv static long INNER_COMPLETED_MASK
INNER_SUBSCRIBED_MASKback to summary
pack-priv static long INNER_SUBSCRIBED_MASK
INNER_WIP_MASKback to summary
pack-priv static long INNER_WIP_MASK
mapperback to summary
pack-priv final Function<? super T, ? extends Publisher<? extends R>> mapper
MAX_HAS_REQUESTback to summary
pack-priv static int MAX_HAS_REQUEST
TERMINATEDback to summary
pack-priv static long TERMINATED

Constructor Detail

FluxSwitchMapNoPrefetchback to summary
pack-priv FluxSwitchMapNoPrefetch(Flux<? extends T> source, Function<? super T, ? extends Publisher<? extends R>> mapper)

Method Detail

addRequestback to summary
pack-priv static long addRequest(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, long previousRequested)

Atomically add increment hasRequest value to indicate that we added capacity to SwitchMapMain#requested

Note, If the given previousRequested param value is greater than zero it works as an indicator that in some scenarios prevents setting HasRequest to 1. Due to racing nature, the SwitchMapMain#requested may be incremented but the following addRequest may be delayed. That will lead that Inner may read the new value and request more data from the inner upstream. In turn, the delay may be that big that inner may fulfill new demand and set hasRequest to 0 faster that addRequest happens and leave SwitchMapMain#requested at zero as well. Thus, we use previousRequested to check if inner was requested, and if it was, we assume the explained case happened and newly added demand was already fulfilled

Parameters
previousRequested:long

received from Operators#addCap method.

Returns:long

next state

getPrefetchback to summary
public int getPrefetch()

Overrides reactor.core.publisher.Flux.getPrefetch.

Doc from reactor.core.publisher.Flux.getPrefetch.

The prefetch configuration of the Flux

Returns:int

the prefetch configuration of the Flux, -1 if unspecified

Annotations
@Override
hasInnerCompletedback to summary
pack-priv static boolean hasInnerCompleted(long state)
hasMainCompletedback to summary
pack-priv static boolean hasMainCompleted(long state)
hasRequestback to summary
pack-priv static int hasRequest(long state)
incrementIndexback to summary
pack-priv static long incrementIndex(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically increment the index of the active inner subscriber. The index will not be changed if the current state is TERMINATED

Returns:long

previous state

indexback to summary
pack-priv static int index(long state)
isInnerSubscribedback to summary
pack-priv static boolean isInnerSubscribed(long state)
isWipback to summary
pack-priv static boolean isWip(long state)
nextIndexback to summary
pack-priv static int nextIndex(long state)
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Overrides reactor.core.publisher.InternalFluxOperator.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the 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 scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
setInnerCompletedback to summary
pack-priv static long setInnerCompleted(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically set the inner completed flag. The flag will not be set if the current state is TERMINATED

Returns:long

previous state

setInnerSubscribedback to summary
pack-priv static long setInnerSubscribed(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, int expectedIndex)

Atomically set a bit on the current state indicating that current inner has received a subscription. If the index has changed during the subscription or stream was cancelled, the bit will not bit set

Returns:long

previous state

setMainCompletedback to summary
pack-priv static long setMainCompleted(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically set main completed flag. The flag will not be set if the current state is TERMINATED

Returns:long

previous state

setTerminatedback to summary
pack-priv static long setTerminated(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance)

Atomically set state as terminated

Returns:long

previous state

setWipback to summary
pack-priv static long setWip(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, int expectedIndex)

Atomically set WIP flag to indicate that we do some work from Inner#OnNext or Inner#OnComplete. If the current state is TERMINATED or the index is one equals to expected then the flag will not be set

Returns:long

previous state

stateback to summary
pack-priv static long state(int index, boolean wip, int hasRequest, boolean innerSubscribed, boolean mainCompleted, boolean innerCompleted)

Generic method to encode state from the given params into a long value

Returns:long

encoded state

subscribeOrReturnback to summary
public CoreSubscriber<? super T> subscribeOrReturn(CoreSubscriber<? super R> actual)

Implements abstract reactor.core.publisher.InternalFluxOperator.subscribeOrReturn.

Implements reactor.core.publisher.OptimizableOperator.subscribeOrReturn.

Doc from reactor.core.publisher.OptimizableOperator.subscribeOrReturn.

Allow delegation of the subscription by returning a CoreSubscriber, or force subscription encapsulation by returning null. This can be used in conjunction with nextOptimizableSource() to perform subscription in a loop instead of by recursion.

Returns:CoreSubscriber<? super T>

next CoreSubscriber or "null" if the subscription was already done inside the method

Annotations
@Override
unsetWipback to summary
pack-priv static long unsetWip(FluxSwitchMapNoPrefetch.SwitchMapMain<?, ?> instance, int expectedIndex, boolean isDemandFulfilled, int expectedRequest)

Atomically unset WIP flag to indicate that we have done the work from Inner#OnNext If the current state is TERMINATED or the index is one equals to expected then the flag will not be set

Returns:long

previous state

reactor.core.publisher back to summary

pack-priv final Class FluxSwitchMapNoPrefetch.SwitchMapInner<T, R>

extends Object
implements InnerConsumer<R>
Class Inheritance
  • java.lang.Object
  • reactor.core.publisher.FluxSwitchMapNoPrefetch.SwitchMapInner
All Implemented Interfaces
reactor.core.publisher.InnerConsumer, reactor.core.Scannable, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber

Field Summary

Modifier and TypeField and Description
pack-priv final CoreSubscriber<? super R>
pack-priv boolean
pack-priv final int
pack-priv final StateLogger
pack-priv T
pack-priv FluxSwitchMapNoPrefetch.SwitchMapInner<T, R>
pack-priv final FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>
pack-priv long
pack-priv long
pack-priv Subscription
s

Constructor Summary

AccessConstructor and Description
pack-priv
SwitchMapInner(FluxSwitchMapNoPrefetch.SwitchMapMain<T, R> parent, CoreSubscriber<? super R> actual, int index, StateLogger logger)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public Context
currentContext()

Overrides default reactor.core.CoreSubscriber.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.
pack-priv boolean
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public void
onNext(R
the element signaled
t
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public void
onSubscribe(Subscription
the Subscription that allows requesting data via Subscription#request(long)
s
)

Implements reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long).
pack-priv void
request(long n)

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

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

actualback to summary
pack-priv final CoreSubscriber<? super R> actual
doneback to summary
pack-priv boolean done
indexback to summary
pack-priv final int index
loggerback to summary
pack-priv final StateLogger logger
Annotations
@Nullable
nextElementback to summary
pack-priv T nextElement
nextInnerback to summary
pack-priv FluxSwitchMapNoPrefetch.SwitchMapInner<T, R> nextInner
parentback to summary
pack-priv final FluxSwitchMapNoPrefetch.SwitchMapMain<T, R> parent
producedback to summary
pack-priv long produced
requestedback to summary
pack-priv long requested
sback to summary
pack-priv Subscription s

Constructor Detail

SwitchMapInnerback to summary
pack-priv SwitchMapInner(FluxSwitchMapNoPrefetch.SwitchMapMain<T, R> parent, CoreSubscriber<? super R> actual, int index, StateLogger logger)

Method Detail

cancelFromParentback to summary
pack-priv void cancelFromParent()
currentContextback to summary
public Context currentContext()

Overrides default reactor.core.CoreSubscriber.currentContext.

Doc from reactor.core.CoreSubscriber.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.

Returns:Context

a resolved context or Context#empty()

Annotations
@Override
isCancelledByParentback to summary
pack-priv boolean isCancelledByParent()
onCompleteback to summary
public void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onNextback to summary
public void onNext(R t)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
t:R

the element signaled

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements reactor.core.CoreSubscriber.onSubscribe.

Doc from reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by 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 reactor.util.Logger. Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

Doc from org.reactivestreams.Subscriber.onSubscribe.

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
requestback to summary
pack-priv void request(long n)
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the 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 scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
reactor.core.publisher back to summary

pack-priv final Class FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>

extends Object
implements InnerOperator<T, R>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.InnerOperator, reactor.core.publisher.InnerProducer, org.reactivestreams.Subscription, reactor.core.Scannable, reactor.core.publisher.InnerConsumer, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber

Field Summary

Modifier and TypeField and Description
pack-priv final CoreSubscriber<? super R>
pack-priv boolean
pack-priv FluxSwitchMapNoPrefetch.SwitchMapInner<T, R>
pack-priv final StateLogger
pack-priv final Function<? super T, ? extends Publisher<? extends R>>
pack-priv volatile long
pack-priv static final AtomicLongFieldUpdater<FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>>
pack-priv Subscription
s

pack-priv volatile long
pack-priv static final AtomicLongFieldUpdater<FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>>
pack-priv volatile Throwable
pack-priv static final AtomicReferenceFieldUpdater<FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>, Throwable>

Constructor Summary

AccessConstructor and Description
pack-priv
SwitchMapMain(CoreSubscriber<? super R> actual, Function<? super T, ? extends Publisher<? extends R>> mapper)

pack-priv
SwitchMapMain(CoreSubscriber<? super R> actual, Function<? super T, ? extends Publisher<? extends R>> mapper, StateLogger logger)

Method Summary

Modifier and TypeMethod and Description
public final CoreSubscriber<? super R>
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
public Stream<? extends Scannable>
inners()

Overrides default reactor.core.Scannable.inners.

Return a Stream of referenced inners (flatmap, multicast etc)
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public void
onNext(T
the element signaled
t
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public void
onSubscribe(Subscription
the Subscription that allows requesting data via Subscription#request(long)
s
)

Implements reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long).
public void
request(long
the strictly positive number of elements to requests to the upstream Publisher
n
)

Implements org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Overrides default reactor.core.publisher.InnerProducer.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.
pack-priv void
subscribeInner(T nextElement, FluxSwitchMapNoPrefetch.SwitchMapInner<T, R> nextInner, int nextIndex)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actualback to summary
pack-priv final CoreSubscriber<? super R> actual
doneback to summary
pack-priv boolean done
innerback to summary
pack-priv FluxSwitchMapNoPrefetch.SwitchMapInner<T, R> inner
loggerback to summary
pack-priv final StateLogger logger
Annotations
@Nullable
mapperback to summary
pack-priv final Function<? super T, ? extends Publisher<? extends R>> mapper
requestedback to summary
pack-priv volatile long requested
REQUESTEDback to summary
pack-priv static final AtomicLongFieldUpdater<FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>> REQUESTED
Annotations
@SuppressWarnings:rawtypes
sback to summary
pack-priv Subscription s
stateback to summary
pack-priv volatile long state
STATEback to summary
pack-priv static final AtomicLongFieldUpdater<FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>> STATE
Annotations
@SuppressWarnings:rawtypes
throwableback to summary
pack-priv volatile Throwable throwable
THROWABLEback to summary
pack-priv static final AtomicReferenceFieldUpdater<FluxSwitchMapNoPrefetch.SwitchMapMain<T, R>, Throwable> THROWABLE
Annotations
@SuppressWarnings:rawtypes

Constructor Detail

SwitchMapMainback to summary
pack-priv SwitchMapMain(CoreSubscriber<? super R> actual, Function<? super T, ? extends Publisher<? extends R>> mapper)
SwitchMapMainback to summary
pack-priv SwitchMapMain(CoreSubscriber<? super R> actual, Function<? super T, ? extends Publisher<? extends R>> mapper, StateLogger logger)

Method Detail

actualback to summary
public final CoreSubscriber<? super R> actual()

Implements reactor.core.publisher.InnerProducer.actual.

Annotations
@Override
cancelback to summary
public void cancel()

Implements org.reactivestreams.Subscription.cancel.

Doc from org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.

Data may still be sent to meet previously signalled demand after calling cancel.

Annotations
@Override
innersback to summary
public Stream<? extends Scannable> inners()

Overrides default reactor.core.Scannable.inners.

Doc from reactor.core.Scannable.inners.

Return a Stream of referenced inners (flatmap, multicast etc)

Returns:Stream<? extends Scannable>

a Stream of referenced inners (flatmap, multicast etc)

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
t:T

the element signaled

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements reactor.core.CoreSubscriber.onSubscribe.

Doc from reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by 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 reactor.util.Logger. Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

Doc from org.reactivestreams.Subscriber.onSubscribe.

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
requestback to summary
public void request(long n)

Implements org.reactivestreams.Subscription.request.

Doc from org.reactivestreams.Subscription.request.

No events will be sent by a Publisher until demand is signaled via this method.

It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the Publisher as "effectively unbounded".

Whatever has been requested can be sent by the Publisher so only signal demand for what can be safely handled.

A Publisher can send less than is requested if the stream ends but then must emit either Subscriber#onError(Throwable) or Subscriber#onComplete().

Parameters
n:long

the strictly positive number of elements to requests to the upstream Publisher

Annotations
@Override
scanUnsafeback to summary
public Object scanUnsafe(Scannable.Attr<T> key)

Overrides default reactor.core.publisher.InnerProducer.scanUnsafe.

Implements reactor.core.Scannable.scanUnsafe.

Doc from reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of the 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 scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.

Parameters
key:Scannable.Attr<T>

a Attr to resolve for the component.

Returns:Object

the value associated to the key for that specific component, or null if none.

Annotations
@Override
@Nullable
subscribeInnerback to summary
pack-priv void subscribeInner(T nextElement, FluxSwitchMapNoPrefetch.SwitchMapInner<T, R> nextInner, int nextIndex)