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
@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 aMulti
containing the items fromPublisher
produced by themapper
for each item emitted by thisMulti
.The operators behaves as follows:
- Returns:
- the object to configure the
flatMap
operation.
-
merge
@CheckReturnValue public Multi<O> merge(int concurrency)
Produces aMulti
containing the items fromPublisher
produced by themapper
for 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
Publisher
are 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
flatMap
operation.
- for each item emitted by this
-
-