public final class Processors
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> BlockingIterable.Processor<T> |
newBlockingIterableProcessor()
Create a new
BlockingIterable.Processor . |
static <T> BlockingIterable.Processor<T> |
newBlockingIterableProcessor(BlockingProcessorSignalsHolder<T> holder)
Create a new
BlockingIterable.Processor . |
static <T> BlockingIterable.Processor<T> |
newBlockingIterableProcessor(int maxBufferSize)
Create a new
BlockingIterable.Processor . |
static CompletableSource.Processor |
newCompletableProcessor()
Create a new
CompletableSource.Processor that allows for multiple
subscribes . |
static <T> PublisherSource.Processor<T,T> |
newPublisherProcessor()
Create a new
PublisherSource.Processor that allows for a single
subscribe . |
static <T> PublisherSource.Processor<T,T> |
newPublisherProcessor(int maxBuffer)
Create a new
PublisherSource.Processor that allows for a single
subscribe . |
static <T> PublisherSource.Processor<T,T> |
newPublisherProcessor(PublisherProcessorSignalsHolder<T> holder)
Create a new
PublisherSource.Processor that allows for a single
subscribe . |
static <T> PublisherSource.Processor<T,T> |
newPublisherProcessorDropHeadOnOverflow(int maxBuffer)
Create a new
PublisherSource.Processor that allows for a single
subscribe . |
static <T> PublisherSource.Processor<T,T> |
newPublisherProcessorDropTailOnOverflow(int maxBuffer)
Create a new
PublisherSource.Processor that allows for a single
subscribe . |
static <T> SingleSource.Processor<T,T> |
newSingleProcessor()
Create a new
SingleSource.Processor that allows for multiple
subscribes . |
public static CompletableSource.Processor newCompletableProcessor()
CompletableSource.Processor
that allows for multiple
subscribes
. The returned
CompletableSource.Processor
provides all the expected API guarantees when used as a
CompletableSource
but does not expect the same guarantees when used as a
CompletableSource.Subscriber
. As an example, users are not expected to call
CompletableSource.Subscriber#onSubscribe(Cancellable)
or they can call any of the
CompletableSource.Subscriber
methods concurrently and/or multiple times.CompletableSource.Processor
that allows for multiple
subscribes
.public static <T> SingleSource.Processor<T,T> newSingleProcessor()
SingleSource.Processor
that allows for multiple
subscribes
. The returned
SingleSource.Processor
provides all the expected API guarantees when used as a
SingleSource
but does not expect the same guarantees when used as a
SingleSource.Subscriber
. As an example, users are not expected to call
SingleSource.Subscriber#onSubscribe(Cancellable)
or they can call any of the
SingleSource.Subscriber
methods concurrently and/or multiple times.T
- The SingleSource
type and SingleSource.Subscriber
type of the
SingleSource.Processor
.SingleSource.Processor
that allows for multiple
subscribes
.public static <T> PublisherSource.Processor<T,T> newPublisherProcessor()
PublisherSource.Processor
that allows for a single
subscribe
. The returned
PublisherSource.Processor
provides all the expected API guarantees when used as a
PublisherSource
but does not expect the same guarantees when used as a
PublisherSource.Subscriber
. As an example, users are not expected to call
PublisherSource.Subscriber#onSubscribe(Subscription)
or they can call any of the
PublisherSource.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.Processor#onNext(Object)
without being delivered to its
PublisherSource.Subscriber
. Use other methods here if a specific strategy is required.
T
- The PublisherSource
type and PublisherSource.Subscriber
type of the
PublisherSource.Processor
.PublisherSource.Processor
that allows for a single
subscribe
.newPublisherProcessor(int)
,
newPublisherProcessor(PublisherProcessorSignalsHolder)
public static <T> PublisherSource.Processor<T,T> newPublisherProcessor(int maxBuffer)
PublisherSource.Processor
that allows for a single
subscribe
. The returned
PublisherSource.Processor
provides all the expected API guarantees when used as a
PublisherSource
but does not expect the same guarantees when used as a
PublisherSource.Subscriber
. As an example, users are not expected to call
PublisherSource.Subscriber#onSubscribe(Subscription)
or they can call any of the
PublisherSource.Subscriber
methods concurrently and/or multiple times.
Only allows for maxBuffer
number of items to be added through
PublisherSource.Processor#onNext(Object)
without being delivered to its
PublisherSource.Subscriber
. If more numbers are added without being delivered, subsequent additions will
fail.
T
- The PublisherSource
type and PublisherSource.Subscriber
type of the
PublisherSource.Processor
.maxBuffer
- Maximum number of items to buffer.PublisherSource.Processor
that allows for a single
subscribe
.public static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropHeadOnOverflow(int maxBuffer)
PublisherSource.Processor
that allows for a single
subscribe
. The returned
PublisherSource.Processor
provides all the expected API guarantees when used as a
PublisherSource
but does not expect the same guarantees when used as a
PublisherSource.Subscriber
. As an example, users are not expected to call
PublisherSource.Subscriber#onSubscribe(Subscription)
or they can call any of the
PublisherSource.Subscriber
methods concurrently and/or multiple times.
Only allows for maxBuffer
number of items to be added through
PublisherSource.Processor#onNext(Object)
without being delivered to its
PublisherSource.Subscriber
. If more numbers are added without being delivered, the oldest buffered item
(head) will be dropped.
T
- The PublisherSource
type and PublisherSource.Subscriber
type of the
PublisherSource.Processor
.maxBuffer
- Maximum number of items to buffer.PublisherSource.Processor
that allows for a single
subscribe
.public static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropTailOnOverflow(int maxBuffer)
PublisherSource.Processor
that allows for a single
subscribe
. The returned
PublisherSource.Processor
provides all the expected API guarantees when used as a
PublisherSource
but does not expect the same guarantees when used as a
PublisherSource.Subscriber
. As an example, users are not expected to call
PublisherSource.Subscriber#onSubscribe(Subscription)
or they can call any of the
PublisherSource.Subscriber
methods concurrently and/or multiple times.
Only allows for maxBuffer
number of items to be added through
PublisherSource.Processor#onNext(Object)
without being delivered to its
PublisherSource.Subscriber
. If more numbers are added without being delivered, the latest buffered item
(tail) will be dropped.
T
- The PublisherSource
type and PublisherSource.Subscriber
type of the
PublisherSource.Processor
.maxBuffer
- Maximum number of items to buffer.PublisherSource.Processor
that allows for a single
subscribe
.public static <T> PublisherSource.Processor<T,T> newPublisherProcessor(PublisherProcessorSignalsHolder<T> holder)
PublisherSource.Processor
that allows for a single
subscribe
. The returned
PublisherSource.Processor
provides all the expected API guarantees when used as a
PublisherSource
. Users are expected to provide same API guarantees from the passed
PublisherProcessorSignalsHolder
as they use the returned PublisherSource.Processor
as a
PublisherSource.Subscriber
. As an example, if users call PublisherSource.Subscriber
methods
concurrently the passed PublisherProcessorSignalsHolder
should support concurrent invocation of its
methods.T
- The PublisherSource
type and PublisherSource.Subscriber
type of the
PublisherSource.Processor
.holder
- A PublisherProcessorSignalsHolder
to store items that are requested to be sent via
PublisherSource.Processor#onNext(Object)
but not yet emitted to the PublisherSource.Subscriber
.PublisherSource.Processor
that allows for a single
subscribe
.public static <T> BlockingIterable.Processor<T> newBlockingIterableProcessor()
BlockingIterable.Processor
.T
- the type of elements emitted by the returned BlockingIterable
.BlockingIterable.Processor
.public static <T> BlockingIterable.Processor<T> newBlockingIterableProcessor(int maxBufferSize)
BlockingIterable.Processor
.T
- the type of elements emitted by the returned BlockingIterable
.maxBufferSize
- Maximum number of items that are requested to be sent via
BlockingIterable.Processor#next(Object)
but not yet emitted from a BlockingIterator
. If this
buffer size is reached a subsequent call to emit
will block till
an item is emitted from a BlockingIterator
.BlockingIterable.Processor
.public static <T> BlockingIterable.Processor<T> newBlockingIterableProcessor(BlockingProcessorSignalsHolder<T> holder)
BlockingIterable.Processor
.T
- the type of elements emitted by the returned BlockingIterable
.holder
- A BlockingProcessorSignalsHolder
to store items that are requested to be sent via
BlockingIterable.Processor#next(Object)
but not yet emitted from a BlockingIterator
.BlockingIterable.Processor
.