public class UniCombine extends Object
| Modifier and Type | Field and Description |
|---|---|
static UniCombine |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
UniZip |
all()
Combines a set of
unis into a joined item. |
UniAny |
any()
Creates a
Uni forwarding the first event (item or failure). |
public static final UniCombine INSTANCE
public UniAny any()
Uni forwarding the first event (item or failure). It behaves like the fastest
of these competing unis. If the passed iterable is empty, the resulting Uni gets a null item
just after subscription.
This method subscribes to the set of Uni. When one of the Uni fires an item or a failure
a failure, the event is propagated downstream. Also the other subscriptions are cancelled.
Note that the callback from the subscriber are called on the thread used to fire the event of the selected
Uni. Use Uni.emitOn(Executor) to change that thread.
If the subscription to the returned Uni is cancelled, the subscription to the unis
contained in the iterable are also cancelled.
Uni.or() for the equivalent operator on Uni instancespublic UniZip all()
unis into a joined item. This item can be a Tuple or the item of a
combinator function.
If one of the combine Uni fire a failure, the other unis are cancelled, and the resulting
Uni fires the failure. If collectFailures() is called,
it waits for the completion of all the unis before propagating the failure event. If more than one
Uni failed, a CompositeException is fired, wrapping the different collected failures.
Depending on the number of participants, the produced Tuple is
different from Tuple2 to Tuple5. For more participants,
use UniZip.unis(Uni[]) or
UniZip.unis(Iterable).
Uni.and() for the equivalent operator on Uni instancesCopyright © 2019–2020 SmallRye. All rights reserved.