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.ProcessorCreate a newCompletableSource.Processorthat allows for multiplesubscribes.static <T> PublisherSource.Processor<T,T> Create a newPublisherSource.Processorthat allows for a singlesubscribe.static <T> PublisherSource.Processor<T,T> newPublisherProcessor(int maxBuffer) Create a newPublisherSource.Processorthat allows for a singlesubscribe.static <T> PublisherSource.Processor<T,T> Create a newPublisherSource.Processorthat allows for a singlesubscribe.static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropHeadOnOverflow(int maxBuffer) Create a newPublisherSource.Processorthat allows for a singlesubscribe.static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropTailOnOverflow(int maxBuffer) Create a newPublisherSource.Processorthat allows for a singlesubscribe.static <T> SingleSource.Processor<T,T> Create a newSingleSource.Processorthat allows for multiplesubscribes.
-
Method Details
-
newCompletableProcessor
Create a newCompletableSource.Processorthat allows for multiplesubscribes. The returnedCompletableSource.Processorprovides all the expected API guarantees when used as aCompletableSourcebut 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.Subscribermethods concurrently and/or multiple times.- Returns:
- a new
CompletableSource.Processorthat allows for multiplesubscribes.
-
newSingleProcessor
Create a newSingleSource.Processorthat allows for multiplesubscribes. The returnedSingleSource.Processorprovides all the expected API guarantees when used as aSingleSourcebut 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.Subscribermethods concurrently and/or multiple times.- Type Parameters:
T- TheSingleSourcetype andSingleSource.Subscribertype of theSingleSource.Processor.- Returns:
- a new
SingleSource.Processorthat allows for multiplesubscribes.
-
newPublisherProcessor
Create a newPublisherSource.Processorthat allows for a singlesubscribe. The returnedPublisherSource.Processorprovides all the expected API guarantees when used as aPublisherSourcebut 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.Subscribermethods 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- ThePublisherSourcetype andPublisherSource.Subscribertype of thePublisherSource.Processor.- Returns:
- a new
PublisherSource.Processorthat allows for a singlesubscribe. - See Also:
-
newPublisherProcessor
Create a newPublisherSource.Processorthat allows for a singlesubscribe. The returnedPublisherSource.Processorprovides all the expected API guarantees when used as aPublisherSourcebut 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.Subscribermethods concurrently and/or multiple times.Only allows for
maxBuffernumber 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- ThePublisherSourcetype andPublisherSource.Subscribertype of thePublisherSource.Processor.- Parameters:
maxBuffer- Maximum number of items to buffer.- Returns:
- a new
PublisherSource.Processorthat allows for a singlesubscribe.
-
newPublisherProcessorDropHeadOnOverflow
public static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropHeadOnOverflow(int maxBuffer) Create a newPublisherSource.Processorthat allows for a singlesubscribe. The returnedPublisherSource.Processorprovides all the expected API guarantees when used as aPublisherSourcebut 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.Subscribermethods concurrently and/or multiple times.Only allows for
maxBuffernumber 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- ThePublisherSourcetype andPublisherSource.Subscribertype of thePublisherSource.Processor.- Parameters:
maxBuffer- Maximum number of items to buffer.- Returns:
- a new
PublisherSource.Processorthat allows for a singlesubscribe.
-
newPublisherProcessorDropTailOnOverflow
public static <T> PublisherSource.Processor<T,T> newPublisherProcessorDropTailOnOverflow(int maxBuffer) Create a newPublisherSource.Processorthat allows for a singlesubscribe. The returnedPublisherSource.Processorprovides all the expected API guarantees when used as aPublisherSourcebut 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.Subscribermethods concurrently and/or multiple times.Only allows for
maxBuffernumber 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- ThePublisherSourcetype andPublisherSource.Subscribertype of thePublisherSource.Processor.- Parameters:
maxBuffer- Maximum number of items to buffer.- Returns:
- a new
PublisherSource.Processorthat allows for a singlesubscribe.
-
newPublisherProcessor
public static <T> PublisherSource.Processor<T,T> newPublisherProcessor(PublisherProcessorSignalsHolder<T> holder) Create a newPublisherSource.Processorthat allows for a singlesubscribe. The returnedPublisherSource.Processorprovides all the expected API guarantees when used as aPublisherSource. Users are expected to provide same API guarantees from the passedPublisherProcessorSignalsHolderas they use the returnedPublisherSource.Processoras aPublisherSource.Subscriber. As an example, if users callPublisherSource.Subscribermethods concurrently the passedPublisherProcessorSignalsHoldershould support concurrent invocation of its methods.- Type Parameters:
T- ThePublisherSourcetype andPublisherSource.Subscribertype of thePublisherSource.Processor.- Parameters:
holder- APublisherProcessorSignalsHolderto store items that are requested to be sent viaPublisherSource.Subscriber.onNext(Object)but not yet emitted to thePublisherSource.Subscriber.- Returns:
- a new
PublisherSource.Processorthat 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 toemitwill 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- ABlockingProcessorSignalsHolderto store items that are requested to be sent viaBlockingIterable.Processor.next(Object)but not yet emitted from aBlockingIterator.- Returns:
- a new
BlockingIterable.Processor.
-