Class UniAny


  • public class UniAny
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static UniAny INSTANCE  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> Uni<T> of​(Uni<? super T>... unis)
      Like of(Iterable) but with an array of Uni as parameter
      <T> Uni<T> of​(java.lang.Iterable<? extends Uni<? super T>> iterable)
      Creates a Uni forwarding the first event (item or failure).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        public static final UniAny INSTANCE
    • Method Detail

      • of

        @SafeVarargs
        @CheckReturnValue
        public final <T> Uni<T> of​(Uni<? super T>... unis)
        Like of(Iterable) but with an array of Uni as parameter
        Type Parameters:
        T - the type of item emitted by the different unis.
        Parameters:
        unis - the array, must not be null, 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 a 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.

        Type Parameters:
        T - the type of item emitted by the different unis.
        Parameters:
        iterable - a set of Uni, must not be null.
        Returns:
        the produced Uni