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 UniCombineINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UniZipall()Combines a set ofunisinto a joined item.UniAnyany()Creates aUniforwarding the first event (item or failure).
-
-
-
Field Detail
-
INSTANCE
public static final UniCombine INSTANCE
-
-
Method Detail
-
any
@CheckReturnValue public UniAny any()
Creates aUniforwarding the first event (item or failure). It behaves like the fastest of these competing unis. If the passed iterable is empty, the resultingUnigets anullitem just after subscription.This method subscribes to the set of
Uni. When one of theUnifires 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. UseUni.emitOn(Executor)to change that thread.If the subscription to the returned
Uniis cancelled, the subscription to theuniscontained in theiterableare also cancelled.- Returns:
- the object to enlist the candidates
-
all
@CheckReturnValue public UniZip all()
Combines a set ofunisinto a joined item. This item can be aTupleor the item of a combinator function.If one of the combine
Unifire a failure, the other unis are cancelled, and the resultingUnifires the failure. IfcollectFailures()is called, it waits for the completion of all theunisbefore propagating the failure event. If more than oneUnifailed, aCompositeExceptionis fired, wrapping the different collected failures.Depending on the number of participants, the produced
Tupleis different fromTuple2toTuple5. For more participants, useUniZip.unis(Uni[])orUniZip.unis(Iterable).- Returns:
- the object to configure the join
-
-