Top Inners Fields Constructors Methods
reactor.core.publisher

pack-priv final Class SinkManyBestEffort<T>

extends Flux<T>
implements InternalManySink<T>, Scannable, DirectInnerContainer<T>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.DirectInnerContainer, reactor.core.Scannable, reactor.core.publisher.InternalManySink, reactor.core.publisher.ContextHolder, reactor.core.publisher.Sinks.Many
Imports
java.util.Objects, java.util.concurrent.atomic.AtomicBoolean, .AtomicLongFieldUpdater, .AtomicReferenceFieldUpdater, java.util.stream.Stream, reactor.core.CoreSubscriber, .Exceptions, .Scannable, reactor.core.publisher.Sinks.EmitResult, reactor.util.annotation.Nullable, reactor.util.context.Context

Deprecated

as a consequence of DirectInnerContainer being deprecated. See corresponding docs for further information.

Author
Simon Baslé

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv static final SinkManyBestEffort.DirectInner<T>[]
pack-priv Throwable
error

Stores the error that terminated this sink, for immediate replay to late subscribers

pack-priv volatile SinkManyBestEffort.DirectInner<T>[]
pack-priv static final AtomicReferenceFieldUpdater<SinkManyBestEffort<T>, SinkManyBestEffort.DirectInner<T>[]>
pack-priv static final SinkManyBestEffort.DirectInner<T>[]
Inherited from reactor.core.publisher.Flux:
ALWAYS_BOOLEAN_SUPPLIERIDENTITY_FUNCTIONLIST_SUPPLIEROBJECT_EQUALSET_SUPPLIERTUPLE2_BIFUNCTION

Constructor Summary

AccessConstructor and Description
pack-priv
SinkManyBestEffort(boolean allOrNothing)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the inner could be added, false if the publisher cannot accept new subscribers
add
(SinkManyBestEffort.DirectInner<T> s)

Implements reactor.core.publisher.DirectInnerContainer.add.

Add a new SinkManyBestEffort.DirectInner to this publisher.
public Flux<T>
asFlux()

Implements reactor.core.publisher.Sinks.Many.asFlux.

Return a Flux view of this sink.
pack-priv static final <T> SinkManyBestEffort<T>
createAllOrNothing()

Deprecated as a consequence of SinkManyBestEffort being deprecated.
pack-priv static final <T> SinkManyBestEffort<T>
createBestEffort()

Deprecated as a consequence of SinkManyBestEffort being deprecated.
public Context
currentContext()

Implements reactor.core.publisher.ContextHolder.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.
public int
currentSubscriberCount()

Implements reactor.core.publisher.Sinks.Many.currentSubscriberCount.

Get how many Subscribers are currently subscribed to the sink.
public Stream<? extends Scannable>
inners()

Overrides default reactor.core.Scannable.inners.

Return a Stream of referenced inners (flatmap, multicast etc)
public void
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 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.
public Sinks.EmitResult
tryEmitComplete()

Implements reactor.core.publisher.Sinks.Many.tryEmitComplete.

Try to terminate the sequence successfully, generating an onComplete signal.
public Sinks.EmitResult
tryEmitError(Throwable
the exception to signal, not null
error
)

Implements reactor.core.publisher.Sinks.Many.tryEmitError.

Try to fail the sequence, generating an onError signal.
public Sinks.EmitResult
tryEmitNext(T
the value to emit, not null
t
)

Implements reactor.core.publisher.Sinks.Many.tryEmitNext.

Try emitting a non-null element, generating an onNext signal.
Inherited from reactor.core.publisher.Flux:
allanyasblockFirstblockFirstblockLastblockLastbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferUntilbufferUntilbufferUntilChangedbufferUntilChangedbufferUntilChangedbufferWhenbufferWhenbufferWhilecachecachecachecachecachecachecancelOncastcheckpointcheckpointcheckpointcollectcollectcollectListcollectMapcollectMapcollectMapcollectMultimapcollectMultimapcollectMultimapcollectSortedListcollectSortedListcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestconcatconcatconcatconcatconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatMapconcatMapconcatMapDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapIterableconcatMapIterableconcatWithconcatWithValuescontextCapturecontextWritecontextWritecountcountingBooleanSuppliercountingPredicatecreatecreatedefaultIfEmptydeferdeferContextualdelayElementsdelayElementsdelaySequencedelaySequencedelaySubscriptiondelaySubscriptiondelaySubscriptiondelayUntildematerializedistinctdistinctdistinctdistinctdistinctUntilChangeddistinctUntilChangeddistinctUntilChangeddoAfterTerminatedoFinallydoFirstdoOnCanceldoOnCompletedoOnDiscarddoOnEachdoOnErrordoOnErrordoOnErrordoOnNextdoOnRequestdoOnSignaldoOnSubscribedoOnTerminateelapsedelapsedelementAtelementAtemptyequalPredicateerrorerrorerrorexpandexpandexpandDeepexpandDeepfilterfilterWhenfilterWhenfirstfirstfirstWithSignalfirstWithSignalfirstWithValuefirstWithValueflatMapflatMapflatMapflatMapflatMapflatMapDelayErrorflatMapIterableflatMapIterableflatMapSequentialflatMapSequentialflatMapSequentialflatMapSequentialflatMapSequentialDelayErrorfromfromArrayfromIterablefromStreamfromStreamgenerategenerategenerategetPrefetchgroupBygroupBygroupBygroupBygroupJoinhandlehasElementhasElementshashSetSupplierhideidentityFunctionignoreElementsindexindexintervalintervalintervalintervaljoinjustjustlastlastlimitRatelimitRatelimitRequestlistSupplierloglogloglogloglogmapmapNotNullmaterializemergemergemergemergemergemergemergemergeComparingmergeComparingmergeComparingmergeComparingDelayErrormergeComparingWithmergeDelayErrormergeOrderedmergeOrderedmergeOrderedmergeOrderedWithmergePrioritymergePrioritymergePrioritymergePriorityDelayErrormergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialDelayErrormergeSequentialDelayErrormergeSequentialDelayErrormergeWithmetricsnamenevernextofTypeonAssemblyonAssemblyonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureDroponBackpressureDroponBackpressureErroronBackpressureLatestonErrorCompleteonErrorCompleteonErrorCompleteonErrorContinueonErrorContinueonErrorContinueonErrorMaponErrorMaponErrorMaponErrorResumeonErrorResumeonErrorResumeonErrorReturnonErrorReturnonErrorReturnonErrorStoponTerminateDetachorparallelparallelparallelpublishpublishpublishpublishpublishNextpublishOnpublishOnpublishOnpublishOnpushpushrangereducereducereduceWithrepeatrepeatrepeatrepeatrepeatWhenreplayreplayreplayreplayreplayreplayretryretryretryWhensamplesamplesampleFirstsampleFirstsampleTimeoutsampleTimeoutscanscanscanWithshareshareNextsinglesinglesingleOrEmptyskipskipskipskipLastskipUntilskipUntilOtherskipWhilesortsortstartWithstartWithstartWithsubscribesubscribesubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeOnsubscribeWithswitchIfEmptyswitchMapswitchMapswitchOnFirstswitchOnFirstswitchOnNextswitchOnNexttagtaketaketaketaketakeLasttakeUntiltakeUntilOthertakeWhiletaptaptapthenthenthenEmptythenManytimedtimedtimeouttimeouttimeouttimeouttimeouttimeouttimeouttimestamptimestamptoIterabletoIterabletoIterabletoStreamtoStreamtoStringtransformtransformDeferredtransformDeferredContextualtuple2FunctionusingusingusingWhenusingWhenwindowwindowwindowwindowwindowwindowwindowwindowTimeoutwindowTimeoutwindowTimeoutwindowTimeoutwindowUntilwindowUntilwindowUntilwindowUntilChangedwindowUntilChangedwindowUntilChangedwindowWhenwindowWhilewindowWhilewithLatestFromwrapwrapToMonozipzipzipzipzipzipzipzipzipzipzipzipzipzipWithzipWithzipWithzipWithzipWithIterablezipWithIterable

Field Detail

allOrNothingback to summary
pack-priv final boolean allOrNothing
EMPTYback to summary
pack-priv static final SinkManyBestEffort.DirectInner<T>[] EMPTY
errorback to summary
pack-priv Throwable error

Stores the error that terminated this sink, for immediate replay to late subscribers

subscribersback to summary
pack-priv volatile SinkManyBestEffort.DirectInner<T>[] subscribers
SUBSCRIBERSback to summary
pack-priv static final AtomicReferenceFieldUpdater<SinkManyBestEffort<T>, SinkManyBestEffort.DirectInner<T>[]> SUBSCRIBERS
Annotations
@SuppressWarnings:rawtypes
TERMINATEDback to summary
pack-priv static final SinkManyBestEffort.DirectInner<T>[] TERMINATED

Constructor Detail

SinkManyBestEffortback to summary
pack-priv SinkManyBestEffort(boolean allOrNothing)

Method Detail

addback to summary
public boolean add(SinkManyBestEffort.DirectInner<T> s)

Implements reactor.core.publisher.DirectInnerContainer.add.

Add a new SinkManyBestEffort.DirectInner to this publisher.

Parameters
s:SinkManyBestEffort.DirectInner<T>

the new SinkManyBestEffort.DirectInner to add

Returns:boolean

true if the inner could be added, false if the publisher cannot accept new subscribers

asFluxback to summary
public Flux<T> asFlux()

Implements reactor.core.publisher.Sinks.Many.asFlux.

Doc from reactor.core.publisher.Sinks.Many.asFlux.

Return a Flux view of this sink. Every call returns the same instance.

Returns:Flux<T>

the Flux view associated to this Sinks.Many

Annotations
@Override
createAllOrNothingback to summary
pack-priv static final <T> SinkManyBestEffort<T> createAllOrNothing()

Deprecated

as a consequence of SinkManyBestEffort being deprecated. See corresponding docs for further information.

createBestEffortback to summary
pack-priv static final <T> SinkManyBestEffort<T> createBestEffort()

Deprecated

as a consequence of SinkManyBestEffort being deprecated. See corresponding docs for further information.

currentContextback to summary
public Context currentContext()

Implements reactor.core.publisher.ContextHolder.currentContext.

Doc from reactor.core.publisher.ContextHolder.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

currentSubscriberCountback to summary
public int currentSubscriberCount()

Implements reactor.core.publisher.Sinks.Many.currentSubscriberCount.

Doc from reactor.core.publisher.Sinks.Many.currentSubscriberCount.

Get how many Subscribers are currently subscribed to the sink.

This is a best effort peek at the sink state, and a subsequent attempt at emitting to the sink might still return EmitResult#FAIL_ZERO_SUBSCRIBER where relevant. (generally in tryEmitNext(Object)). Request (and lack thereof) isn't taken into account, all registered subscribers are counted.

Returns:int

the number of subscribers at the time of invocation

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
removeback to summary
public void remove(SinkManyBestEffort.DirectInner<T> s)

Implements reactor.core.publisher.DirectInnerContainer.remove.

Remove an SinkManyBestEffort.DirectInner from this publisher. Does nothing if the inner is not currently managed by the publisher.

Parameters
s:SinkManyBestEffort.DirectInner<T>

the SinkManyBestEffort.DirectInner to remove

Annotations
@SuppressWarnings:unchecked
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
@Nullable
@Override
subscribeback to summary
public void subscribe(CoreSubscriber<? super T> actual)

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

Implements reactor.core.CorePublisher.subscribe.

Doc from reactor.core.publisher.Flux.subscribe.

An internal Publisher#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.

Parameters
actual:CoreSubscriber<? super T>

the Subscriber interested into the published sequence

Annotations
@Override
tryEmitCompleteback to summary
public Sinks.EmitResult tryEmitComplete()

Implements reactor.core.publisher.Sinks.Many.tryEmitComplete.

Doc from reactor.core.publisher.Sinks.Many.tryEmitComplete.

Try to terminate the sequence successfully, generating an onComplete signal. The result of the attempt is represented as an EmitResult, which possibly indicates error cases.

See the list of failure EmitResult in emitComplete(EmitFailureHandler) javadoc for an example of how each of these can be dealt with, to decide if the emit API would be a good enough fit instead.

Returns:Sinks.EmitResult

an EmitResult, which should be checked to distinguish different possible failures

Annotations
@Override
tryEmitErrorback to summary
public Sinks.EmitResult tryEmitError(Throwable error)

Implements reactor.core.publisher.Sinks.Many.tryEmitError.

Doc from reactor.core.publisher.Sinks.Many.tryEmitError.

Try to fail the sequence, generating an onError signal. The result of the attempt is represented as an EmitResult, which possibly indicates error cases.

See the list of failure EmitResult in emitError(Throwable, EmitFailureHandler) javadoc for an example of how each of these can be dealt with, to decide if the emit API would be a good enough fit instead.

Parameters
error:Throwable

the exception to signal, not null

Returns:Sinks.EmitResult

an EmitResult, which should be checked to distinguish different possible failures

Annotations
@Override
tryEmitNextback to summary
public Sinks.EmitResult tryEmitNext(T t)

Implements reactor.core.publisher.Sinks.Many.tryEmitNext.

Doc from reactor.core.publisher.Sinks.Many.tryEmitNext.

Try emitting a non-null element, generating an onNext signal. The result of the attempt is represented as an EmitResult, which possibly indicates error cases.

See the list of failure EmitResult in emitNext(Object, EmitFailureHandler) javadoc for an example of how each of these can be dealt with, to decide if the emit API would be a good enough fit instead.

Might throw an unchecked exception as a last resort (eg. in case of a fatal error downstream which cannot be propagated to any asynchronous handler, a bubbling exception, ...).

Parameters
t:T

the value to emit, not null

Returns:Sinks.EmitResult

an EmitResult, which should be checked to distinguish different possible failures

Annotations
@Override
reactor.core.publisher back to summary

pack-priv Class SinkManyBestEffort.DirectInner<T>

extends AtomicBoolean
implements InnerProducer<T>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.InnerProducer, org.reactivestreams.Subscription, reactor.core.Scannable

Field Summary

Modifier and TypeField and Description
pack-priv final CoreSubscriber<? super T>
pack-priv final DirectInnerContainer<T>
parent

Deprecated as a consequence of DirectInnerContainer being deprecated.
pack-priv volatile long
pack-priv static final AtomicLongFieldUpdater<SinkManyBestEffort.DirectInner<T>>

Constructor Summary

AccessConstructor and Description
pack-priv
DirectInner(CoreSubscriber<? super T> actual, DirectInnerContainer<T> parent)

Deprecated as a consequence of DirectInnerContainer being deprecated.

Method Summary

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

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
pack-priv void
directEmitNext(T
the value to emit
value
)

Emit a value to the downstream, unless it doesn't have sufficient demand.

pack-priv void
pack-priv void
pack-priv boolean
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.

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

Returns:

true if enough demand and not cancelled, false otherwise
tryEmitNext
(T
the value to emit
value
)

Try to emit if the downstream is not cancelled and has some demand.

Inherited from java.util.concurrent.atomic.AtomicBoolean:
compareAndExchangecompareAndExchangeAcquirecompareAndExchangeReleasecompareAndSetgetgetAcquiregetAndSetgetOpaquegetPlainlazySetsetsetOpaquesetPlainsetReleasetoStringweakCompareAndSetweakCompareAndSetAcquireweakCompareAndSetPlainweakCompareAndSetReleaseweakCompareAndSetVolatile

Field Detail

actualback to summary
pack-priv final CoreSubscriber<? super T> actual
parentback to summary
pack-priv final DirectInnerContainer<T> parent

Deprecated

as a consequence of DirectInnerContainer being deprecated. See corresponding docs for further information.

requestedback to summary
pack-priv volatile long requested
REQUESTEDback to summary
pack-priv static final AtomicLongFieldUpdater<SinkManyBestEffort.DirectInner<T>> REQUESTED
Annotations
@SuppressWarnings:rawtypes

Constructor Detail

DirectInnerback to summary
pack-priv DirectInner(CoreSubscriber<? super T> actual, DirectInnerContainer<T> parent)

Deprecated

as a consequence of DirectInnerContainer being deprecated. See corresponding docs for further information.

Method Detail

actualback to summary
public CoreSubscriber<? super T> 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
directEmitNextback to summary
pack-priv void directEmitNext(T value)

Emit a value to the downstream, unless it doesn't have sufficient demand. In that case, the downstream is terminated with an Exceptions#failWithOverflow().

Parameters
value:T

the value to emit

emitCompleteback to summary
pack-priv void emitComplete()
emitErrorback to summary
pack-priv void emitError(Throwable e)
isCancelledback to summary
pack-priv boolean isCancelled()
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.

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
tryEmitNextback to summary
pack-priv boolean tryEmitNext(T value)

Try to emit if the downstream is not cancelled and has some demand.

Parameters
value:T

the value to emit

Returns:boolean

true if enough demand and not cancelled, false otherwise