Class MultiConcat
- java.lang.Object
-
- io.smallrye.mutiny.groups.MultiConcat
-
public class MultiConcat extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MultiConcat(boolean collectFailures)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiConcat
collectFailures()
Indicates that the concatenation process should not propagate the first received failure, but collect them until all the items from all (non-failing) participants have been emitted.<T> Multi<T>
streams(java.lang.Iterable<? extends org.reactivestreams.Publisher<T>> iterable)
<T> Multi<T>
streams(org.reactivestreams.Publisher<T>... publishers)
-
-
-
Method Detail
-
streams
@SafeVarargs @CheckReturnValue public final <T> Multi<T> streams(org.reactivestreams.Publisher<T>... publishers)
Creates a newMulti
concatenating the items emitted by the givenmultis
/publishers
.If you pass no
publishers
, the resultingMulti
emits the completion event immediately after subscription. If you pass a singlepublisher
, the resultingMulti
emits the events from thatpublisher
. If you pass multiplepublishers
, the resultingMulti
emits the events from the firstpublisher
. When this one emits the completion event, it drops that event and emits the events from the nextpublisher
and so on until it reaches the lastpublisher
. When the lastpublisher
is consumed, it sends the completion event.If any of the
publisher
emits a failure, the failure is passed downstream and the concatenation stops. This behavior can be changed usingcollectFailures()
. In this case, the failures are accumulated and would be propagated instead of the final completion event. If multiple failures have been collected, the downstream receives aCompositeException
, otherwise it receives the collected failure. IMPORTANT: The order of thepublisher
matters.
-
streams
@CheckReturnValue public <T> Multi<T> streams(java.lang.Iterable<? extends org.reactivestreams.Publisher<T>> iterable)
Creates a newMulti
concatenating the items emitted by the givenmultis
/publishers
.If you pass no
publishers
, the resultingMulti
emits the completion event immediately after subscription. If you pass a singlepublisher
, the resultingMulti
emits the events from thatpublisher
. If you pass multiplepublishers
, the resultingMulti
emits the events from the firstpublisher
. When this one emits the completion event, it drops that event and emits the events from the secondpublisher
and so on until it reaches the lastpublisher
. When the lastpublisher
is consumed, it sends the completion event.If any of the
publisher
emits a failure, the failure is passed downstream and the concatenation stops. This behavior can be changed usingcollectFailures()
. In this case, the failures are accumulated and would be propagated instead of the final completion event. If multiple failures have been collected, the downstream receives aCompositeException
, otherwise it receives the collected failure. IMPORTANT: The order of thepublisher
matters.
-
collectFailures
@CheckReturnValue public MultiConcat collectFailures()
Indicates that the concatenation process should not propagate the first received failure, but collect them until all the items from all (non-failing) participants have been emitted. Then, the failures are propagated downstream (as aCompositeException
if several failures have been received).- Returns:
- this
MultiConcat
configured to collect the failures.
-
-