Top Description Fields Constructors Methods
io.rsocket.internal

public final Class UnboundedProcessor

extends Flux<ByteBuf>
implements Scannable, Disposable, CoreSubscriber<ByteBuf>, Fuseable.QueueSubscription<ByteBuf>, Fuseable
Class Inheritance
All Implemented Interfaces
reactor.core.Fuseable, reactor.core.Fuseable.QueueSubscription, org.reactivestreams.Subscription, java.util.Queue, java.util.Collection, java.lang.Iterable, reactor.core.CoreSubscriber, org.reactivestreams.Subscriber, reactor.core.Disposable, reactor.core.Scannable
Imports
io.netty.buffer.ByteBuf, io.rsocket.internal.jctools.queues.MpscUnboundedArrayQueue, java.util.Objects, .Queue, java.util.concurrent.CancellationException, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, .AtomicLongFieldUpdater, java.util.stream.Stream, org.reactivestreams.Subscription, reactor.core.CoreSubscriber, .Disposable, .Exceptions, .Fuseable, .Scannable, reactor.core.publisher.Flux, .Operators, reactor.util.annotation.Nullable, reactor.util.concurrent.Queues, reactor.util.context.Context

A Processor implementation that takes a custom queue and allows only a single subscriber.

The implementation keeps the order of signals.

Field Summary

Modifier and TypeField and Description
pack-priv CoreSubscriber<? super ByteBuf>
pack-priv boolean
pack-priv static final AtomicIntegerFieldUpdater<UnboundedProcessor>
pack-priv volatile int
pack-priv boolean
pack-priv Throwable
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv static final long
pack-priv ByteBuf
pack-priv static final long
pack-priv final Runnable
pack-priv boolean
pack-priv final Queue<ByteBuf>
pack-priv final Queue<ByteBuf>
pack-priv volatile long
pack-priv static final AtomicLongFieldUpdater<UnboundedProcessor>
pack-priv volatile long
pack-priv static final AtomicLongFieldUpdater<UnboundedProcessor>

Constructor Summary

AccessConstructor and Description
public
public
UnboundedProcessor(Runnable onFinalizedHook)

Method Summary

Modifier and TypeMethod and Description
pack-priv static long
addWork(long state)

public void
cancel()

Implements org.reactivestreams.Subscription.cancel.

Request the Publisher to stop sending data and clean up resources.
pack-priv boolean
checkTerminated(boolean done, boolean empty, CoreSubscriber<? super ByteBuf> a)

public void
clear()

Implements java.util.Collection.clear.

Clears all elements from queues and set state to terminate.
pack-priv static void
clearAndFinalize(UnboundedProcessor instance)

Set flag FLAG_FINALIZED and release(ByteBuf) all the elements from queue and priorityQueue.

pack-priv void
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.
public void
dispose()

Implements reactor.core.Disposable.dispose.

Deprecated
Cancel or dispose the underlying task or resource.
pack-priv void
drainRegular(long previousState)

public int
getPrefetch()

Overrides reactor.core.publisher.Flux.getPrefetch.

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

pack-priv static boolean
hasValue(long state)

public Stream<Scannable>
inners()

Overrides default reactor.core.Scannable.inners.

Return a Stream of referenced inners (flatmap, multicast etc)
pack-priv static boolean
isCancelled(long state)

public boolean
isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.
pack-priv static boolean
isDisposed(long state)

public boolean
isEmpty()

Implements java.util.Collection.isEmpty.

Returns true if this collection contains no elements.
pack-priv static boolean
isFinalized(long state)

pack-priv static boolean
isSubscribedOnce(long state)

pack-priv static boolean
isSubscriberReady(long state)

pack-priv static boolean
isTerminated(long state)

pack-priv static boolean
isWorkInProgress(long state)

pack-priv static long

Returns:

previous state
markCancelled
(UnboundedProcessor instance)

Sets FLAG_CANCELLED flag if it was not set before and if flag FLAG_FINALIZED is unset.

pack-priv static long

Returns:

previous state
markDisposed
(UnboundedProcessor instance)

Sets FLAG_DISPOSED flag if it was not set before and if flags FLAG_FINALIZED, FLAG_CANCELLED are unset.

pack-priv static long

Returns:

previous state
markRequestAdded
(UnboundedProcessor instance)

Sets FLAG_HAS_REQUEST flag if it was not set before and if flags FLAG_FINALIZED, FLAG_CANCELLED, FLAG_DISPOSED are unset.

pack-priv static long

Returns:

true if FLAG_SUBSCRIBED_ONCE was successfully set
markSubscribedOnce
(UnboundedProcessor instance)

Sets FLAG_SUBSCRIBED_ONCE flag if it was not set before and if flags FLAG_FINALIZED, FLAG_CANCELLED or FLAG_DISPOSED are unset

pack-priv static long

Returns:

previous state
markSubscriberReady
(UnboundedProcessor instance)

Sets FLAG_SUBSCRIBER_READY flag if flags FLAG_FINALIZED, FLAG_CANCELLED or FLAG_DISPOSED are unset

pack-priv static long

Returns:

previous state
markTerminatedOrFinalized
(UnboundedProcessor instance)

Sets FLAG_TERMINATED flag if it was not set before and if flags FLAG_FINALIZED, FLAG_CANCELLED, FLAG_DISPOSED are unset.

pack-priv static long

Returns:

previous state
markValueAdded
(UnboundedProcessor instance)

Sets FLAG_HAS_VALUE flag if it was not set before and if flags FLAG_FINALIZED, FLAG_CANCELLED, FLAG_DISPOSED are unset.

pack-priv static long

Returns:

previous state
markValueAddedAndTerminated
(UnboundedProcessor instance)

Sets FLAG_HAS_VALUE flag if it was not set before and if flags FLAG_FINALIZED, FLAG_CANCELLED, FLAG_DISPOSED are unset.

pack-priv static long

Returns:

state after changing WIP or current state if update failed
markWorkDone
(UnboundedProcessor instance, long expectedState, boolean hasRequest, boolean hasValue)

Decrements the amount of work in progress by the given amount on the given state.

public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

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

Implements org.reactivestreams.Subscriber.onError.

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

Implements org.reactivestreams.Subscriber.onNext.

Deprecated
Data notification sent by the Publisher in response to requests to Subscription#request(long).
public void
onNextPrioritized(ByteBuf t)

Deprecated
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 ByteBuf
poll()

Implements java.util.Queue.poll.

Retrieves and removes the head of this queue, or returns null if this queue is empty.
pack-priv static void
release(ByteBuf byteBuf)

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
)

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 ByteBuf>
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 boolean
public boolean
public boolean
Inherited from reactor.core.publisher.Flux:
allanyasblockFirstblockFirstblockLastblockLastbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferTimeoutbufferUntilbufferUntilbufferUntilChangedbufferUntilChangedbufferUntilChangedbufferWhenbufferWhenbufferWhilecachecachecachecachecachecachecancelOncastcheckpointcheckpointcheckpointcollectcollectcollectListcollectMapcollectMapcollectMapcollectMultimapcollectMultimapcollectMultimapcollectSortedListcollectSortedListcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestcombineLatestconcatconcatconcatconcatconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatDelayErrorconcatMapconcatMapconcatMapDelayErrorconcatMapDelayErrorconcatMapDelayErrorconcatMapIterableconcatMapIterableconcatWithconcatWithValuescontextCapturecontextWritecontextWritecountcreatecreatedefaultIfEmptydeferdeferContextualdelayElementsdelayElementsdelaySequencedelaySequencedelaySubscriptiondelaySubscriptiondelaySubscriptiondelayUntildematerializedistinctdistinctdistinctdistinctdistinctUntilChangeddistinctUntilChangeddistinctUntilChangeddoAfterTerminatedoFinallydoFirstdoOnCanceldoOnCompletedoOnDiscarddoOnEachdoOnErrordoOnErrordoOnErrordoOnNextdoOnRequestdoOnSubscribedoOnTerminateelapsedelapsedelementAtelementAtemptyerrorerrorerrorexpandexpandexpandDeepexpandDeepfilterfilterWhenfilterWhenfirstfirstfirstWithSignalfirstWithSignalfirstWithValuefirstWithValueflatMapflatMapflatMapflatMapflatMapDelayErrorflatMapIterableflatMapIterableflatMapSequentialflatMapSequentialflatMapSequentialflatMapSequentialDelayErrorfromfromArrayfromIterablefromStreamfromStreamgenerategenerategenerategroupBygroupBygroupBygroupBygroupJoinhandlehasElementhasElementshideignoreElementsindexindexintervalintervalintervalintervaljoinjustjustlastlastlimitRatelimitRatelimitRequestloglogloglogloglogmapmapNotNullmaterializemergemergemergemergemergemergemergeComparingmergeComparingmergeComparingmergeComparingDelayErrormergeComparingWithmergeDelayErrormergeOrderedmergeOrderedmergeOrderedmergeOrderedWithmergePrioritymergePrioritymergePrioritymergePriorityDelayErrormergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialmergeSequentialDelayErrormergeSequentialDelayErrormergeSequentialDelayErrormergeWithmetricsnamenevernextofTypeonAssemblyonAssemblyonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureBufferonBackpressureDroponBackpressureDroponBackpressureErroronBackpressureLatestonErrorCompleteonErrorCompleteonErrorCompleteonErrorContinueonErrorContinueonErrorContinueonErrorMaponErrorMaponErrorMaponErrorResumeonErrorResumeonErrorResumeonErrorReturnonErrorReturnonErrorReturnonErrorStoponTerminateDetachorparallelparallelparallelpublishpublishpublishpublishpublishNextpublishOnpublishOnpublishOnpushpushrangereducereducereduceWithrepeatrepeatrepeatrepeatrepeatWhenreplayreplayreplayreplayreplayreplayretryretryretryWhensamplesamplesampleFirstsampleFirstsampleTimeoutsampleTimeoutscanscanscanWithshareshareNextsinglesinglesingleOrEmptyskipskipskipskipLastskipUntilskipUntilOtherskipWhilesortsortstartWithstartWithstartWithsubscribesubscribesubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeOnsubscribeWithswitchIfEmptyswitchMapswitchMapswitchOnFirstswitchOnFirstswitchOnNextswitchOnNexttagtaketaketaketaketakeLasttakeUntiltakeUntilOthertakeWhiletaptaptapthenthenthenEmptythenManytimedtimedtimeouttimeouttimeouttimeouttimeouttimeouttimeouttimestamptimestamptoIterabletoIterabletoIterabletoStreamtoStreamtoStringtransformtransformDeferredtransformDeferredContextualusingusingusingWhenusingWhenwindowwindowwindowwindowwindowwindowwindowwindowTimeoutwindowTimeoutwindowTimeoutwindowTimeoutwindowUntilwindowUntilwindowUntilwindowUntilChangedwindowUntilChangedwindowUntilChangedwindowWhenwindowWhilewindowWhilewithLatestFromzipzipzipzipzipzipzipzipzipzipzipzipzipzipWithzipWithzipWithzipWithzipWithIterablezipWithIterable