Package io.smallrye.mutiny.groups
Class MultiFlatten<I,O>
- 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>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
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
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
public Multi<O> merge()
Produces aMulticontaining the items fromPublisherproduced by themapperfor each item emitted by thisMulti.The operators behaves as follows:
- Returns:
- the object to configure the
flatMapoperation.
-
merge
public Multi<O> merge(int concurrency)
Produces aMulticontaining the items fromPublisherproduced 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 aPublisher(potentially aMulti). The mapper must not returnnull - The items contained in each of the produced
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
-
-