public class UniAny extends Object
| Modifier and Type | Method and Description |
|---|---|
<T> Uni<T> |
of(Iterable<? extends Uni<? super T>> iterable)
Creates a
Uni forwarding the first event (item or failure). |
<T> Uni<T> |
of(Uni<? super T>... unis)
Like
of(Iterable) but with an array of Uni as parameter |
public static final UniAny INSTANCE
@SafeVarargs public final <T> Uni<T> of(Uni<? super T>... unis)
of(Iterable) but with an array of Uni as parameterT - the type of item emitted by the different unis.unis - the array, must not be null, must not contain @{code null}Unipublic <T> Uni<T> of(Iterable<? extends Uni<? super T>> iterable)
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.
Copyright © 2019–2020 SmallRye. All rights reserved.