Package io.smallrye.mutiny.groups
Class UniAny
- java.lang.Object
-
- io.smallrye.mutiny.groups.UniAny
-
public class UniAny extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Uni<T>
of(Uni<? super T>... unis)
Likeof(Iterable)
but with an array ofUni
as parameter<T> Uni<T>
of(java.lang.Iterable<? extends Uni<? super T>> iterable)
Creates aUni
forwarding the first event (item or failure).
-
-
-
Field Detail
-
INSTANCE
public static final UniAny INSTANCE
-
-
Method Detail
-
of
@SafeVarargs @CheckReturnValue public final <T> Uni<T> of(Uni<? super T>... unis)
Likeof(Iterable)
but with an array ofUni
as parameter- Type Parameters:
T
- the type of item emitted by the different unis.- Parameters:
unis
- the array, must not benull
, must not contain @{code null}- Returns:
- the produced
Uni
-
of
@CheckReturnValue public <T> Uni<T> of(java.lang.Iterable<? extends Uni<? super T>> iterable)
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 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.
-
-