- java.lang.Object
-
- io.smallrye.mutiny.groups.MultiFlatten<I,O>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiFlatten<I,O>collectFailures()Instructs the flatMap operation to consume all the streams returned by the mapper before propagating a failure if any of the stream has produced a failure.Multi<O>concatenate()Multi<O>concatenate(boolean prefetch)Multi<O>merge()Multi<O>merge(int concurrency)MultiFlatten<I,O>withRequests(int requests)Configures the number the items requested to the streams produced by the mapper.
-
-
-
Method Detail
-
collectFailures
@CheckReturnValue public MultiFlatten<I,O> collectFailures()
Instructs the flatMap operation to consume all the streams returned by the mapper before propagating a failure if any of the stream has produced a failure.If more than one failure is collected, the propagated failure is a
CompositeException.- Returns:
- this
MultiFlatten
-
withRequests
@CheckReturnValue public MultiFlatten<I,O> withRequests(int requests)
Configures the number the items requested to the streams produced by the mapper.- Parameters:
requests- the requests, must be strictly positive- Returns:
- this
MultiFlatten
-
merge
@CheckReturnValue public Multi<O> merge()
Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.The operators behaves as follows:
- for each item emitted by this
Multi, the mapper is called and produces aFlow.Publisher(potentially aMulti). The mapper must not returnnull - The items contained in each of the produced
Flow.Publisherare then merged in the producedMulti. The returned object lets you configure the flattening process.
- Returns:
- the object to configure the
flatMapoperation.
- for each item emitted by this
-
merge
@CheckReturnValue public Multi<O> merge(int concurrency)
Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.The operators behaves as follows:
- for each item emitted by this
Multi, the mapper is called and produces aFlow.Publisher(potentially aMulti). The mapper must not returnnull - The items contained in each of the produced
Flow.Publisherare then merged in the producedMulti. The returned object lets you configure the flattening process.
This method allows configuring the concurrency, i.e. the maximum number of in-flight/subscribed inner streams
- Parameters:
concurrency- the concurrency- Returns:
- the object to configure the
flatMapoperation.
- for each item emitted by this
-
concatenate
@CheckReturnValue public Multi<O> concatenate(boolean prefetch)
Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.The operators behaves as follows:
- for each item emitted by this
Multi, the mapper is called and produces aFlow.Publisher(potentially aMulti). The mapper must not returnnull - The items contained in each of the produced
Flow.Publisherare then concatenated in the producedMulti. The returned object lets you configure the flattening process. - If
prefetchis set totrue,flatMapoperator is used with upstream prefetch ofrequestsparameter configured previously. - If
prefetchis set tofalse,concatMapoperator is used without prefetch, meaning that items are requested lazily from the upstream, one at a time.
- Parameters:
prefetch- whether the operator prefetches items from upstream, or not.- Returns:
- the object to configure the
concatMapoperation.
- for each item emitted by this
-
concatenate
@CheckReturnValue public Multi<O> concatenate()
Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.The operators behaves as follows:
- for each item emitted by this
Multi, the mapper is called and produces aFlow.Publisher(potentially aMulti). The mapper must not returnnull - The items contained in each of the produced
Flow.Publisherare then concatenated in the producedMulti. The returned object lets you configure the flattening process. - This operator defaults to without prefetch, meaning that items are requested lazily from the upstream, one at a time.
- Returns:
- the object to configure the
concatMapoperation.
- for each item emitted by this
-
-