Top Description Fields Constructors Methods
reactor.core.publisher

public final Class UnicastProcessor<T>

extends FluxProcessor<T, T>
implements Fuseable.QueueSubscription<T>, Fuseable, InnerOperator<T, T>, InternalManySink<T>
Class Inheritance
All Implemented Interfaces
reactor.core.publisher.InternalManySink, reactor.core.publisher.ContextHolder, reactor.core.publisher.Sinks.Many, reactor.core.Scannable, reactor.core.publisher.InnerOperator, reactor.core.publisher.InnerProducer, org.reactivestreams.Subscription, reactor.core.publisher.InnerConsumer, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber, reactor.core.Fuseable, reactor.core.Fuseable.QueueSubscription, java.util.Queue, java.util.Collection, java.lang.Iterable
Annotations
@Deprecated
Type Parameters
<T>
the input and output type
Imports
java.util.Objects, .Queue, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, .AtomicLongFieldUpdater, .AtomicReferenceFieldUpdater, java.util.function.Consumer, java.util.stream.Stream, org.reactivestreams.Subscription, reactor.core.CoreSubscriber, .Disposable, .Exceptions, .Fuseable, .Scannable, reactor.core.publisher.Sinks.EmitResult, reactor.util.annotation.Nullable, reactor.util.concurrent.Queues, reactor.util.context.Context

Deprecated

to be removed in 3.5, prefer clear cut usage of Sinks through variations under Sinks.many().unicast().

A Processor implementation that takes a custom queue and allows only a single subscriber. UnicastProcessor allows multiplexing of the events which means that it supports multiple producers and only one consumer. However, it should be noticed that multi-producer case is only valid if appropriate Queue is provided. Otherwise, it could break Reactive Streams Spec if Publishers publish on different threads.



Note

UnicastProcessor does not respect the actual subscriber's demand as it is described in Reactive Streams Spec. However, UnicastProcessor embraces configurable Queue internally which allows enabling backpressure support and preventing of consumer's overwhelming. Hence, interaction model between producers and UnicastProcessor will be PUSH only. In opposite, interaction model between UnicastProcessor and consumer will be PUSH-PULL as defined in Reactive Streams Spec. In the case when upstream's signals overflow the bound of internal Queue, UnicastProcessor will fail with signaling onError( reactor.core.Exceptions.OverflowException).



Note

The implementation keeps the order of signals. That means that in case of terminal signal (completion or error signals) it will be postponed until all of the previous signals has been consumed.

Field Summary

Modifier and TypeField and Description
pack-priv volatile CoreSubscriber<? super T>
pack-priv volatile boolean
pack-priv static final AtomicIntegerFieldUpdater<UnicastProcessor<T>>
pack-priv volatile int
pack-priv volatile boolean
pack-priv Throwable
pack-priv boolean
pack-priv static final AtomicReferenceFieldUpdater<UnicastProcessor<T>, Disposable>
pack-priv volatile int
pack-priv static final AtomicIntegerFieldUpdater<UnicastProcessor<T>>
pack-priv final Consumer<? super T>
pack-priv volatile Disposable
pack-priv boolean
pack-priv final Queue<T>
pack-priv volatile long
pack-priv static final AtomicLongFieldUpdater<UnicastProcessor<T>>
pack-priv volatile int
pack-priv static final AtomicIntegerFieldUpdater<UnicastProcessor<T>>

Constructor Summary

AccessConstructor and Description
public
public
UnicastProcessor(Queue<T> queue, Disposable onTerminate)

public
UnicastProcessor(Queue<T> queue, Consumer<? super T> onOverflow, Disposable onTerminate)

Deprecated

Method Summary

Modifier and TypeMethod and Description
public CoreSubscriber<? super T>
public Flux<T>
asFlux()

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

Return a Flux view of this sink.
public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
pack-priv boolean
checkTerminated(boolean d, boolean empty, CoreSubscriber<? super T> a, Queue<T> q, T t)

public void
clear()

Implements java.util.Collection.clear.

Removes all of the elements from this collection (optional operation).
public static <
the relayed type
E
>
UnicastProcessor<E>

Returns:

a unicast FluxProcessor
create
()

Deprecated use Sinks.many().unicast().onBackpressureBuffer() (or the unsafe variant if you're sure about external synchronization).
Create a new UnicastProcessor that will buffer on an internal queue in an unbounded fashion.
public static <
the relayed type
E
>
UnicastProcessor<E>

Returns:

a unicast FluxProcessor
create
(Queue<E>
the buffering queue
queue
)

Deprecated use Sinks.many().unicast().onBackpressureBuffer(queue) (or the unsafe variant if you're sure about external synchronization).
Create a new UnicastProcessor that will buffer on a provided queue in an unbounded fashion.
public static <
the relayed type
E
>
UnicastProcessor<E>

Returns:

a unicast FluxProcessor
create
(Queue<E>
the buffering queue
queue
,
Disposable
called on any terminal signal
endcallback
)

Deprecated use Sinks.many().unicast().onBackpressureBuffer(queue, endCallback) (or the unsafe variant if you're sure about external synchronization).
Create a new UnicastProcessor that will buffer on a provided queue in an unbounded fashion.
public static <
the relayed type
E
>
UnicastProcessor<E>

Returns:

a unicast FluxProcessor
create
(Queue<E>
the buffering queue
queue
,
Consumer<? super E>
called when queue.offer return false and unicastProcessor is about to emit onError.
onOverflow
,
Disposable
called on any terminal signal
endcallback
)

Deprecated use Sinks.many().unicast().onBackpressureBuffer(queue, endCallback) (or the unsafe variant if you're sure about external synchronization).
Create a new UnicastProcessor that will buffer on a provided queue in an unbounded fashion.
public Context
public int
currentSubscriberCount()

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

Get how many Subscribers are currently subscribed to the sink.
pack-priv void
public long
downstreamCount()

Overrides reactor.core.publisher.FluxProcessor.downstreamCount.

Return the number of active Subscriber or -1 if untracked.
pack-priv void
drain(T dataSignalOfferedBeforeDrain)

pack-priv void
drainFused(CoreSubscriber<? super T> a)

pack-priv void
public void
emitNext(T
the value to emit, not null
value
,
Sinks.EmitFailureHandler
the failure handler that allows retrying failed EmitResult.
failureHandler
)

Overrides default reactor.core.publisher.InternalManySink.emitNext.

A simplified attempt at emitting a non-null element via the tryEmitNext(Object) API, generating an onNext signal.
public int
getBufferSize()

Overrides reactor.core.publisher.FluxProcessor.getBufferSize.

Return the processor buffer capacity if any or Integer#MAX_VALUE
public Throwable
getError()

Overrides reactor.core.publisher.FluxProcessor.getError.

Current error if any, default to null
public int
getPrefetch()

Overrides reactor.core.publisher.Flux.getPrefetch.

The prefetch configuration of the Flux
public boolean
hasDownstreams()

Overrides reactor.core.publisher.FluxProcessor.hasDownstreams.

Return true if any Subscriber is actively subscribed
public Stream<Scannable>
inners()

Overrides reactor.core.publisher.FluxProcessor.inners.

Overrides default reactor.core.Scannable.inners.

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

Overrides default reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.
public boolean
isEmpty()

Implements java.util.Collection.isEmpty.

Returns true if this collection contains no elements.
protected boolean
public boolean
isTerminated()

Overrides reactor.core.publisher.FluxProcessor.isTerminated.

Has this upstream finished or "completed" / "failed" ?
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

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

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, org.reactivestreams.Subscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long).
public T
poll()

Implements java.util.Queue.poll.

Retrieves and removes the head of this queue, or returns null if this queue is empty.
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 int
requestFusion(int
the mode requested by the intermediate operator
requestedMode
)

Implements reactor.core.Fuseable.QueueSubscription.requestFusion.

Request a specific fusion mode from this QueueSubscription.
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Overrides reactor.core.publisher.FluxProcessor.scanUnsafe.

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.
public int
size()

Implements java.util.Collection.size.

Returns the number of elements in this collection.
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
t
)

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.FluxProcessor:
disposehasCompletedhasErrorisSerializedserializeserializeAlwayssinksinkswitchOnNextwrap

Field Detail

actualback to summary
pack-priv volatile CoreSubscriber<? super T> actual
cancelledback to summary
pack-priv volatile boolean cancelled
DISCARD_GUARDback to summary
pack-priv static final AtomicIntegerFieldUpdater<UnicastProcessor<T>> DISCARD_GUARD
Annotations
@SuppressWarnings:rawtypes
discardGuardback to summary
pack-priv volatile int discardGuard
doneback to summary
pack-priv volatile boolean done
errorback to summary
pack-priv Throwable error
hasDownstreamback to summary
pack-priv boolean hasDownstream
ON_TERMINATEback to summary
pack-priv static final AtomicReferenceFieldUpdater<UnicastProcessor<T>, Disposable> ON_TERMINATE
Annotations
@SuppressWarnings:rawtypes
onceback to summary
pack-priv volatile int once
ONCEback to summary
pack-priv static final AtomicIntegerFieldUpdater<UnicastProcessor<T>> ONCE
Annotations
@SuppressWarnings:rawtypes
onOverflowback to summary
pack-priv final Consumer<? super T> onOverflow
onTerminateback to summary
pack-priv volatile Disposable onTerminate
outputFusedback to summary
pack-priv boolean outputFused
queueback to summary
pack-priv final Queue<T> queue
requestedback to summary
pack-priv volatile long requested
REQUESTEDback to summary
pack-priv static final AtomicLongFieldUpdater<UnicastProcessor<T>> REQUESTED
Annotations
@SuppressWarnings:rawtypes
wipback to summary
pack-priv volatile int wip
WIPback to summary
pack-priv static final AtomicIntegerFieldUpdater<UnicastProcessor<T>> WIP
Annotations
@SuppressWarnings:rawtypes

Constructor Detail

UnicastProcessorback to summary
public UnicastProcessor(Queue<T> queue)
UnicastProcessorback to summary
public UnicastProcessor(Queue<T> queue, Disposable onTerminate)
UnicastProcessorback to summary
public UnicastProcessor(Queue<T> queue, Consumer<? super T> onOverflow, Disposable onTerminate)

Deprecated

Annotations
@Deprecated

Method Detail

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

Implements reactor.core.publisher.InnerProducer.actual.

Annotations
@Override
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
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
checkTerminatedback to summary
pack-priv boolean checkTerminated(boolean d, boolean empty, CoreSubscriber<? super T> a, Queue<T> q, T t)
clearback to summary
public void clear()

Implements java.util.Collection.clear.

Doc from java.util.Collection.clear.

Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.

Annotations
@Override
createback to summary
public static <E> UnicastProcessor<E> create()

Deprecated

use Sinks.many().unicast().onBackpressureBuffer() (or the unsafe variant if you're sure about external synchronization). To be removed in 3.5.

Create a new UnicastProcessor that will buffer on an internal queue in an unbounded fashion.

Parameters
<E>
the relayed type
Returns:UnicastProcessor<E>

a unicast FluxProcessor

Annotations
@Deprecated
createback to summary
public static <E> UnicastProcessor<E> create(Queue<E> queue)

Deprecated

use Sinks.many().unicast().onBackpressureBuffer(queue) (or the unsafe variant if you're sure about external synchronization). To be removed in 3.5.

Create a new UnicastProcessor that will buffer on a provided queue in an unbounded fashion.

Parameters
<E>
the relayed type
queue:Queue<E>

the buffering queue

Returns:UnicastProcessor<E>

a unicast FluxProcessor

Annotations
@Deprecated
createback to summary
public static <E> UnicastProcessor<E> create(Queue<E> queue, Disposable endcallback)

Deprecated

use Sinks.many().unicast().onBackpressureBuffer(queue, endCallback) (or the unsafe variant if you're sure about external synchronization). To be removed in 3.5.

Create a new UnicastProcessor that will buffer on a provided queue in an unbounded fashion.

Parameters
<E>
the relayed type
queue:Queue<E>

the buffering queue

endcallback:Disposable

called on any terminal signal

Returns:UnicastProcessor<E>

a unicast FluxProcessor

Annotations
@Deprecated
createback to summary
public static <E> UnicastProcessor<E> create(Queue<E> queue, Consumer<? super E> onOverflow, Disposable endcallback)

Deprecated

use Sinks.many().unicast().onBackpressureBuffer(queue, endCallback) (or the unsafe variant if you're sure about external synchronization). The onOverflow callback is not supported anymore. To be removed in 3.5.

Create a new UnicastProcessor that will buffer on a provided queue in an unbounded fashion.

Parameters
<E>
the relayed type
queue:Queue<E>

the buffering queue

onOverflow:Consumer<? super E>

called when queue.offer return false and unicastProcessor is about to emit onError.

endcallback:Disposable

called on any terminal signal

Returns:UnicastProcessor<E>

a unicast FluxProcessor

Annotations
@Deprecated
currentContextback to summary
public Context currentContext()

Overrides reactor.core.publisher.FluxProcessor.currentContext.

Overrides default reactor.core.publisher.InnerOperator.currentContext, reactor.core.CoreSubscriber.currentContext.

Implements reactor.core.publisher.ContextHolder.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
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
doTerminateback to summary
pack-priv void doTerminate()
downstreamCountback to summary
public long downstreamCount()

Overrides reactor.core.publisher.FluxProcessor.downstreamCount.

Doc from reactor.core.publisher.FluxProcessor.downstreamCount.

Return the number of active Subscriber or -1 if untracked.

Returns:long

the number of active Subscriber or -1 if untracked

Annotations
@Override
drainback to summary
pack-priv void drain(T dataSignalOfferedBeforeDrain)
drainFusedback to summary
pack-priv void drainFused(CoreSubscriber<? super T> a)
drainRegularback to summary
pack-priv void drainRegular(CoreSubscriber<? super T> a)
emitNextback to summary
public void emitNext(T value, Sinks.EmitFailureHandler failureHandler)

Overrides default reactor.core.publisher.InternalManySink.emitNext.

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

A simplified attempt at emitting a non-null element via the tryEmitNext(Object) API, generating an onNext signal. If the result of the attempt is not a success, implementations SHOULD retry the tryEmitNext(Object) call IF the provided EmitFailureHandler returns true. Otherwise, failures are dealt with in a predefined way that might depend on the actual sink implementation (see below for the vanilla reactor-core behavior).

Generally, tryEmitNext(Object) is preferable since it allows a custom handling of error cases, although this implies checking the returned EmitResult and correctly acting on it. This API is intended as a good default for convenience.

When the EmitResult is not a success, vanilla reactor-core operators have the following behavior:

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, a EmitResult#FAIL_NON_SERIALIZED as described above, ...).

Parameters
value:T

the value to emit, not null

failureHandler:Sinks.EmitFailureHandler

the failure handler that allows retrying failed EmitResult.

Annotations
@Override
getBufferSizeback to summary
public int getBufferSize()

Overrides reactor.core.publisher.FluxProcessor.getBufferSize.

Doc from reactor.core.publisher.FluxProcessor.getBufferSize.

Return the processor buffer capacity if any or Integer#MAX_VALUE

Returns:int

processor buffer capacity if any or Integer#MAX_VALUE

Annotations
@Override
getErrorback to summary
public Throwable getError()

Overrides reactor.core.publisher.FluxProcessor.getError.

Doc from reactor.core.publisher.FluxProcessor.getError.

Current error if any, default to null

Returns:Throwable

Current error if any, default to null

Annotations
@Override
@Nullable
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
hasDownstreamsback to summary
public boolean hasDownstreams()

Overrides reactor.core.publisher.FluxProcessor.hasDownstreams.

Doc from reactor.core.publisher.FluxProcessor.hasDownstreams.

Return true if any Subscriber is actively subscribed

Returns:boolean

true if any Subscriber is actively subscribed

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

Overrides reactor.core.publisher.FluxProcessor.inners.

Overrides default reactor.core.Scannable.inners.

Doc from reactor.core.Scannable.inners.

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

Returns:Stream<Scannable>

a Stream of referenced inners (flatmap, multicast etc)

Annotations
@Override
isDisposedback to summary
public boolean isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Doc from reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.

Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.

Returns:boolean

true when there's a guarantee the resource or task is disposed.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements java.util.Collection.isEmpty.

Doc from java.util.Collection.isEmpty.

Returns true if this collection contains no elements.

Returns:boolean

true if this collection contains no elements

Annotations
@Override
isIdentityProcessorback to summary
protected boolean isIdentityProcessor()

Overrides reactor.core.publisher.FluxProcessor.isIdentityProcessor.

Doc from reactor.core.publisher.FluxProcessor.isIdentityProcessor.

Return true if FluxProcessor<T, T>

Returns:boolean

true if FluxProcessor<T, T>

Annotations
@Override
isTerminatedback to summary
public boolean isTerminated()

Overrides reactor.core.publisher.FluxProcessor.isTerminated.

Doc from reactor.core.publisher.FluxProcessor.isTerminated.

Has this upstream finished or "completed" / "failed" ?

Returns:boolean

has this upstream finished or "completed" / "failed" ?

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 throwable)

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
throwable: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, org.reactivestreams.Subscriber.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
pollback to summary
public T poll()

Implements java.util.Queue.poll.

Doc from java.util.Queue.poll.

Retrieves and removes the head of this queue, or returns null if this queue is empty.

Returns:T

the head of this queue, or null if this queue is empty

Annotations
@Override
@Nullable
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
requestFusionback to summary
public int requestFusion(int requestedMode)

Implements reactor.core.Fuseable.QueueSubscription.requestFusion.

Doc from reactor.core.Fuseable.QueueSubscription.requestFusion.

Request a specific fusion mode from this QueueSubscription.

One should request either SYNC, ASYNC or ANY modes (never NONE) and the implementor should return NONE, SYNC or ASYNC (never ANY).

For example, if a source supports only ASYNC fusion but the intermediate operator supports only SYNC fuseable sources, the operator may request SYNC fusion and the source can reject it via NONE, thus the operator can return NONE as well to downstream and the fusion doesn't happen.

Parameters
requestedMode:int

the mode requested by the intermediate operator

Returns:int

the actual fusion mode activated

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

Overrides reactor.core.publisher.FluxProcessor.scanUnsafe.

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
sizeback to summary
public int size()

Implements java.util.Collection.size.

Doc from java.util.Collection.size.

Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this collection

Annotations
@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 t)

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
t: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