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 MultiConcatcollectFailures()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 public final <T> Multi<T> streams(org.reactivestreams.Publisher<T>... publishers)
Creates a newMulticoncatenating the items emitted by the givenmultis/publishers.If you pass no
publishers, the resultingMultiemits the completion event immediately after subscription. If you pass a singlepublisher, the resultingMultiemits the events from thatpublisher. If you pass multiplepublishers, the resultingMultiemits the events from the firstpublisher. When this one emits the completion event, it drops that event and emits the events from the nextpublisherand so on until it reaches the lastpublisher. When the lastpublisheris consumed, it sends the completion event.If any of the
publisheremits 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 thepublishermatters.
-
streams
public <T> Multi<T> streams(java.lang.Iterable<? extends org.reactivestreams.Publisher<T>> iterable)
Creates a newMulticoncatenating the items emitted by the givenmultis/publishers.If you pass no
publishers, the resultingMultiemits the completion event immediately after subscription. If you pass a singlepublisher, the resultingMultiemits the events from thatpublisher. If you pass multiplepublishers, the resultingMultiemits the events from the firstpublisher. When this one emits the completion event, it drops that event and emits the events from the secondpublisherand so on until it reaches the lastpublisher. When the lastpublisheris consumed, it sends the completion event.If any of the
publisheremits 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 thepublishermatters.
-
collectFailures
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 aCompositeExceptionif several failures have been received).- Returns:
- this
MultiConcatconfigured to collect the failures.
-
-