java.lang.Object
io.smallrye.mutiny.groups.MultiFlatten<I,O>
- Type Parameters:
I- the type of item emitted by the upstreamMultiO- the type of item emitted by the returnedMulti
The object to tune the flatMap operation
-
Method Summary
Modifier and TypeMethodDescriptionInstructs 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.Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.concatenate(boolean prefetch) Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.merge()Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.merge(int concurrency) Produces aMulticontaining the items fromFlow.Publisherproduced by themapperfor each item emitted by thisMulti.withRequests(int requests) Configures the number the items requested to the streams produced by the mapper.
-
Method Details
-
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
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
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
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
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
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
-