Multi by concatenating several Multi or Flow.Publisher.
This class allows configuring how the concatenation is executed. Unlike a merge, a concatenation emits the items in
order. Streams are read one-by-one and the items are emitted in this order.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIndicates 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(Iterable<? extends Flow.Publisher<T>> iterable) final <T> Multi<T> streams(Flow.Publisher<T>... publishers)
-
Constructor Details
-
MultiConcat
public MultiConcat(boolean collectFailures)
-
-
Method Details
-
streams
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 the
publishermatters. -
streams
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 the
publishermatters. -
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.
-