Class UniCombine
- java.lang.Object
-
- io.smallrye.mutiny.groups.UniCombine
-
public class UniCombine extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static UniCombine
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UniZip
all()
Combines a set ofunis
into a joined item.UniAny
any()
Creates aUni
forwarding the first event (item or failure).
-
-
-
Field Detail
-
INSTANCE
public static final UniCombine INSTANCE
-
-
Method Detail
-
any
@CheckReturnValue public UniAny any()
Creates aUni
forwarding the first event (item or failure). It behaves like the fastest of these competing unis. If the passed iterable is empty, the resultingUni
gets anull
item just after subscription.This method subscribes to the set of
Uni
. When one of theUni
fires an item or 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
. UseUni.emitOn(Executor)
to change that thread.If the subscription to the returned
Uni
is cancelled, the subscription to theunis
contained in theiterable
are also cancelled.- Returns:
- the object to enlist the candidates
-
all
@CheckReturnValue public UniZip all()
Combines a set ofunis
into a joined item. This item can be aTuple
or the item of a combinator function.If one of the combine
Uni
fire a failure, the other unis are cancelled, and the resultingUni
fires the failure. IfcollectFailures()
is called, it waits for the completion of all theunis
before propagating the failure event. If more than oneUni
failed, aCompositeException
is fired, wrapping the different collected failures.Depending on the number of participants, the produced
Tuple
is different fromTuple2
toTuple5
. For more participants, useUniZip.unis(Uni[])
orUniZip.unis(Iterable)
.- Returns:
- the object to configure the join
-
-