Module io.helidon.common.reactive
Package io.helidon.common.reactive
Class MultiFlatMapProcessor<T,X>
- java.lang.Object
-
- io.helidon.common.reactive.BaseProcessor<T,X>
-
- io.helidon.common.reactive.MultiFlatMapProcessor<T,X>
-
- Type Parameters:
T- input item typeX- output item type
- All Implemented Interfaces:
Multi<X>,Subscribable<X>,Flow.Processor<T,X>,Flow.Publisher<X>,Flow.Subscriber<T>,Flow.Subscription
public class MultiFlatMapProcessor<T,X> extends BaseProcessor<T,X> implements Multi<X>
Flatten the elements emitted by publishers produced by the mapper function to this stream.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMultiFlatMapProcessor()Create newMultiFlatMapProcessor.protectedMultiFlatMapProcessor(Function<T,Flow.Publisher<X>> mapper)Create newMultiFlatMapProcessorwith item toIterablemapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()protected voidcomplete()Complete by sending onComplete signal to down stream.static <T,R>
MultiFlatMapProcessor<T,R>fromIterableMapper(Function<T,Iterable<R>> mapper)Create newMultiFlatMapProcessorwith item toIterablemapper.static <T,U>
MultiFlatMapProcessor<T,U>fromPublisherMapper(Function<T,Flow.Publisher<U>> mapper)Create newMultiFlatMapProcessorwith item toFlow.Publishermapper.protected MultiFlatMapProcessor<T,X>mapper(Function<T,Flow.Publisher<X>> mapper)Set mapper used for publisher creation.voidrequest(long n)request and cancel are not guaranteed to be thread-safe by the Publisher but this is not interacting with any state of this Processor - thread-safety is sub's concern - eventually the problem of the Publisher that provides the highest level Subscription.protected voidsubmit(T item)Invoke actual onNext signal to down stream.-
Methods inherited from class io.helidon.common.reactive.BaseProcessor
complete, downstreamSubscribe, getError, getSubscriber, getSubscription, next, onComplete, onError, onNext, onSubscribe, setError, subscribe
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.Flow.Publisher
subscribe
-
Methods inherited from interface io.helidon.common.reactive.Multi
collect, collect, collectList, collectStream, defaultIfEmpty, distinct, dropWhile, filter, first, flatMap, flatMap, flatMapIterable, flatMapIterable, forEach, limit, map, onComplete, onError, onErrorResume, onErrorResumeWith, onTerminate, peek, reduce, reduce, skip, switchIfEmpty, takeUntil, takeWhile
-
Methods inherited from interface io.helidon.common.reactive.Subscribable
subscribe, subscribe, subscribe, subscribe
-
-
-
-
Constructor Detail
-
MultiFlatMapProcessor
protected MultiFlatMapProcessor()
Create newMultiFlatMapProcessor.
-
MultiFlatMapProcessor
protected MultiFlatMapProcessor(Function<T,Flow.Publisher<X>> mapper)
Create newMultiFlatMapProcessorwith item toIterablemapper.- Parameters:
mapper- to provide iterable for every item from upstream
-
-
Method Detail
-
fromIterableMapper
public static <T,R> MultiFlatMapProcessor<T,R> fromIterableMapper(Function<T,Iterable<R>> mapper)
Create newMultiFlatMapProcessorwith item toIterablemapper.- Type Parameters:
T- input item typeR- output item type- Parameters:
mapper- to provide iterable for every item from upstream- Returns:
MultiFlatMapProcessor
-
fromPublisherMapper
public static <T,U> MultiFlatMapProcessor<T,U> fromPublisherMapper(Function<T,Flow.Publisher<U>> mapper)
Create newMultiFlatMapProcessorwith item toFlow.Publishermapper.- Type Parameters:
T- input item typeU- output item type- Parameters:
mapper- to provide iterable for every item from upstream- Returns:
MultiFlatMapProcessor
-
mapper
protected MultiFlatMapProcessor<T,X> mapper(Function<T,Flow.Publisher<X>> mapper)
Set mapper used for publisher creation.- Parameters:
mapper- function used for publisher creation- Returns:
MultiFlatMapProcessor
-
submit
protected void submit(T item)
Description copied from class:BaseProcessorInvoke actual onNext signal to down stream.- Specified by:
submitin classBaseProcessor<T,X>- Parameters:
item- to be sent down stream
-
complete
protected void complete()
Description copied from class:BaseProcessorComplete by sending onComplete signal to down stream.- Overrides:
completein classBaseProcessor<T,X>
-
request
public void request(long n)
Description copied from class:BaseProcessorrequest and cancel are not guaranteed to be thread-safe by the Publisher but this is not interacting with any state of this Processor - thread-safety is sub's concern - eventually the problem of the Publisher that provides the highest level Subscription.- Specified by:
requestin interfaceFlow.Subscription- Overrides:
requestin classBaseProcessor<T,X>
-
cancel
public void cancel()
- Specified by:
cancelin interfaceFlow.Subscription- Overrides:
cancelin classBaseProcessor<T,X>
-
-