Class UniJoin


  • @Experimental("New API based on observations that Uni.combine() is often used with homogeneous types, and combination often just a mapping to a collection.")
    public class UniJoin
    extends java.lang.Object
    Join multiple Unis.

    Note about emptiness: If the set of Unis is empty, the set is rejected. Joining an empty set would not propagate any event as it would not subscribe to anything. As a result, you cannot join empty sets of Unis. An IllegalArgumentException will be thrown in this case.

    • Field Detail

      • SHARED_INSTANCE

        public static final UniJoin SHARED_INSTANCE
    • Method Detail

      • all

        @SafeVarargs
        @CheckReturnValue
        public final <T> UniJoin.JoinAllStrategy<T> all​(Uni<T>... unis)
        Join multiple Uni references and emit a list of values, this is a convenience delegate method for all(List).

        The list of Unis must not be null, empty, or contain null objects.

        Type Parameters:
        T - the type of the Uni values
        Parameters:
        unis - the list of Uni to join, must not be null or empty, must not contain any null reference.
        Returns:
        the object to configure the failure management strategy
      • all

        @CheckReturnValue
        public final <T> UniJoin.JoinAllStrategy<T> all​(java.util.List<Uni<T>> unis)
        Join multiple Uni references and emit a list of values.

        The resulting list of values is in order of the list of Uni. What happens when any of the Uni emits a failure rather than a value is specified by a subsequent call to any of the methods in UniJoin.JoinAllStrategy.

        The list of Unis must not be null, empty, or contain null objects.

        Type Parameters:
        T - the type of the Uni values
        Parameters:
        unis - the list of Uni to join, must not be null, must not contain any null reference
        Returns:
        the object to configure the failure management strategy
      • first

        @SafeVarargs
        @CheckReturnValue
        public final <T> UniJoin.JoinFirstStrategy<T> first​(Uni<T>... unis)
        Join multiple Uni and emit the result from the first one to emit a signal, or the first one with a value. This is a convenience delegate method for first(List).

        The list of Unis must not be null, empty, or contain null objects.

        Type Parameters:
        T - the type of the Uni values
        Parameters:
        unis - the list of Uni to join, must not be null, empty and must not contain any null reference
        Returns:
        the object to configure the failure management strategy
      • first

        @CheckReturnValue
        public final <T> UniJoin.JoinFirstStrategy<T> first​(java.util.List<Uni<T>> unis)
        Join multiple Uni and emit the result from the first one to emit a signal, or the first one with a value.

        What happens when any of the Uni emits a failure rather than a value is specified by a subsequent call to any of the methods in UniJoin.JoinFirstStrategy.

        The list of Unis must not be null, empty, or contain null objects.

        Type Parameters:
        T - the type of the Uni values
        Parameters:
        unis - the list of Uni to join, must not be null, empty, must not contain any null reference
        Returns:
        the object to configure the failure management strategy
      • builder

        @CheckReturnValue
        public <T> UniJoin.Builder<T> builder()
        Provide a builder to assemble the Uni references to join.
        Type Parameters:
        T - the type of the Uni values
        Returns:
        a new builder