Class Processors
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BlockingIterable.Processor<T>
Create a newBlockingIterable.Processor
.static <T> BlockingIterable.Processor<T>
newBlockingIterableProcessor
(int maxBufferSize) Create a newBlockingIterable.Processor
.static <T> BlockingIterable.Processor<T>
Create a newBlockingIterable.Processor
.static CompletableSource.Processor
Create a newCompletableSource.Processor
that allows for multiplesubscribes
.static <T> PublisherSource.Processor<T,
T> Create a newPublisherSource.Processor
that allows for a singlesubscribe
.static <T> PublisherSource.Processor<T,
T> newPublisherProcessor
(int maxBuffer) Create a newPublisherSource.Processor
that allows for a singlesubscribe
.static <T> PublisherSource.Processor<T,
T> Create a newPublisherSource.Processor
that allows for a singlesubscribe
.static <T> PublisherSource.Processor<T,
T> newPublisherProcessorDropHeadOnOverflow
(int maxBuffer) Create a newPublisherSource.Processor
that allows for a singlesubscribe
.static <T> PublisherSource.Processor<T,
T> newPublisherProcessorDropTailOnOverflow
(int maxBuffer) Create a newPublisherSource.Processor
that allows for a singlesubscribe
.static <T> SingleSource.Processor<T,
T> Create a newSingleSource.Processor
that allows for multiplesubscribes
.
-
Method Details
-
newCompletableProcessor
Create a newCompletableSource.Processor
that allows for multiplesubscribes
. The returnedCompletableSource.Processor
provides all the expected API guarantees when used as aCompletableSource
but does not expect the same guarantees when used as aCompletableSource.Subscriber
. As an example, users are not expected to callCompletableSource.Subscriber.onSubscribe(Cancellable)
or they can call any of theCompletableSource.Subscriber
methods concurrently and/or multiple times.- Returns:
- a new
CompletableSource.Processor
that allows for multiplesubscribes
.
-
newSingleProcessor
Create a newSingleSource.Processor
that allows for multiplesubscribes
. The returnedSingleSource.Processor
provides all the expected API guarantees when used as aSingleSource
but does not expect the same guarantees when used as aSingleSource.Subscriber
. As an example, users are not expected to callSingleSource.Subscriber.onSubscribe(Cancellable)
or they can call any of theSingleSource.Subscriber
methods concurrently and/or multiple times.- Type Parameters:
T
- TheSingleSource
type andSingleSource.Subscriber
type of theSingleSource.Processor
.- Returns:
- a new
SingleSource.Processor
that allows for multiplesubscribes
.
-
newPublisherProcessor
Create a newPublisherSource.Processor
that allows for a singlesubscribe
. The returnedPublisherSource.Processor
provides all the expected API guarantees when used as aPublisherSource
but does not expect the same guarantees when used as aPublisherSource.Subscriber
. As an example, users are not expected to callPublisherSource.Subscriber.onSubscribe(Subscription)
or they can call any of thePublisherSource.Subscriber
methods concurrently and/or multiple times.The returned may choose a default strategy to handle the cases when more items are added through
PublisherSource.Subscriber.onNext(Object)
without being delivered to itsPublisherSource.Subscriber
. Use other methods here if a specific strategy is required.- Type Parameters:
T
- ThePublisherSource
type andPublisherSource.Subscriber
type of thePublisherSource.Processor
.- Returns:
- a new
PublisherSource.Processor
that allows for a singlesubscribe
. - See Also:
-
newPublisherProcessor
Create a newPublisherSource.Processor
that allows for a singlesubscribe
. The returnedPublisherSource.Processor
provides all the expected API guarantees when used as aPublisherSource
but does not expect the same guarantees when used as aPublisherSource.Subscriber
. As an example, users are not expected to callPublisherSource.Subscriber.onSubscribe(Subscription)
or they can call any of thePublisherSource.Subscriber
methods concurrently and/or multiple times.Only allows for
maxBuffer
number of items to be added throughPublisherSource.Subscriber.onNext(Object)
without being delivered to itsPublisherSource.Subscriber
. If more items are added without being delivered, subsequent additions will fail.- Type Parameters:
T
- ThePublisherSource
type andPublisherSource.Subscriber
type of thePublisherSource.Processor
.- Parameters:
maxBuffer
- Maximum number of items to buffer.- Returns:
- a new
PublisherSource.Processor
that allows for a singlesubscribe
.
-
newPublisherProcessorDropHeadOnOverflow
public static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropHeadOnOverflow(int maxBuffer) Create a newPublisherSource.Processor
that allows for a singlesubscribe
. The returnedPublisherSource.Processor
provides all the expected API guarantees when used as aPublisherSource
but does not expect the same guarantees when used as aPublisherSource.Subscriber
. As an example, users are not expected to callPublisherSource.Subscriber.onSubscribe(Subscription)
or they can call any of thePublisherSource.Subscriber
methods concurrently and/or multiple times.Only allows for
maxBuffer
number of items to be added throughPublisherSource.Subscriber.onNext(Object)
without being delivered to itsPublisherSource.Subscriber
. If more items are added without being delivered, the oldest buffered item (head) will be dropped.- Type Parameters:
T
- ThePublisherSource
type andPublisherSource.Subscriber
type of thePublisherSource.Processor
.- Parameters:
maxBuffer
- Maximum number of items to buffer.- Returns:
- a new
PublisherSource.Processor
that allows for a singlesubscribe
.
-
newPublisherProcessorDropTailOnOverflow
public static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropTailOnOverflow(int maxBuffer) Create a newPublisherSource.Processor
that allows for a singlesubscribe
. The returnedPublisherSource.Processor
provides all the expected API guarantees when used as aPublisherSource
but does not expect the same guarantees when used as aPublisherSource.Subscriber
. As an example, users are not expected to callPublisherSource.Subscriber.onSubscribe(Subscription)
or they can call any of thePublisherSource.Subscriber
methods concurrently and/or multiple times.Only allows for
maxBuffer
number of items to be added throughPublisherSource.Subscriber.onNext(Object)
without being delivered to itsPublisherSource.Subscriber
. If more items are added without being delivered, the latest buffered item (tail) will be dropped.- Type Parameters:
T
- ThePublisherSource
type andPublisherSource.Subscriber
type of thePublisherSource.Processor
.- Parameters:
maxBuffer
- Maximum number of items to buffer.- Returns:
- a new
PublisherSource.Processor
that allows for a singlesubscribe
.
-
newPublisherProcessor
public static <T> PublisherSource.Processor<T,T> newPublisherProcessor(PublisherProcessorSignalsHolder<T> holder) Create a newPublisherSource.Processor
that allows for a singlesubscribe
. The returnedPublisherSource.Processor
provides all the expected API guarantees when used as aPublisherSource
. Users are expected to provide same API guarantees from the passedPublisherProcessorSignalsHolder
as they use the returnedPublisherSource.Processor
as aPublisherSource.Subscriber
. As an example, if users callPublisherSource.Subscriber
methods concurrently the passedPublisherProcessorSignalsHolder
should support concurrent invocation of its methods.- Type Parameters:
T
- ThePublisherSource
type andPublisherSource.Subscriber
type of thePublisherSource.Processor
.- Parameters:
holder
- APublisherProcessorSignalsHolder
to store items that are requested to be sent viaPublisherSource.Subscriber.onNext(Object)
but not yet emitted to thePublisherSource.Subscriber
.- Returns:
- a new
PublisherSource.Processor
that allows for a singlesubscribe
.
-
newBlockingIterableProcessor
Create a newBlockingIterable.Processor
.- Type Parameters:
T
- the type of elements emitted by the returnedBlockingIterable
.- Returns:
- a new
BlockingIterable.Processor
.
-
newBlockingIterableProcessor
Create a newBlockingIterable.Processor
.- Type Parameters:
T
- the type of elements emitted by the returnedBlockingIterable
.- Parameters:
maxBufferSize
- Maximum number of items that are requested to be sent viaBlockingIterable.Processor.next(Object)
but not yet emitted from aBlockingIterator
. If this buffer size is reached a subsequent call toemit
will block till an item is emitted from aBlockingIterator
.- Returns:
- a new
BlockingIterable.Processor
.
-
newBlockingIterableProcessor
public static <T> BlockingIterable.Processor<T> newBlockingIterableProcessor(BlockingProcessorSignalsHolder<T> holder) Create a newBlockingIterable.Processor
.- Type Parameters:
T
- the type of elements emitted by the returnedBlockingIterable
.- Parameters:
holder
- ABlockingProcessorSignalsHolder
to store items that are requested to be sent viaBlockingIterable.Processor.next(Object)
but not yet emitted from aBlockingIterator
.- Returns:
- a new
BlockingIterable.Processor
.
-