Class UniAndGroup2<T1,T2>

java.lang.Object
io.smallrye.mutiny.groups.UniAndGroupIterable<T1>
io.smallrye.mutiny.groups.UniAndGroup2<T1,T2>
Type Parameters:
T1 - the type of item of the first Uni
T2 - the type of item of the second Uni

public class UniAndGroup2<T1,T2> extends UniAndGroupIterable<T1>
Configures the combination of 2 unis.
  • Constructor Details

    • UniAndGroup2

      public UniAndGroup2(Uni<? extends T1> source, Uni<? extends T2> other)
  • Method Details

    • collectFailures

      @CheckReturnValue public UniAndGroup2<T1,T2> collectFailures()
      Configure the processing to wait until all the unis to fire an event (item or failure) before firing the failure. If several failures have been collected, a CompositeException is fired wrapping the different failures.
      Overrides:
      collectFailures in class UniAndGroupIterable<T1>
      Returns:
      the current UniAndGroup2
    • asTuple

      @CheckReturnValue public Uni<Tuple2<T1,T2>> asTuple()
      Returns:
      the resulting Uni. The items are combined into a Tuple2<T1, T2>.
    • usingConcurrencyOf

      @CheckReturnValue public UniAndGroup2<T1,T2> usingConcurrencyOf(int level)
      Limit the number of concurrent upstream subscriptions.

      When not specified all upstream Uni are being subscribed when the combining Uni is subscribed.

      Setting a limit is useful when you have a large number of Uni to combine and their simultaneous subscriptions might overwhelm resources (e.g., database connections, etc).

      Overrides:
      usingConcurrencyOf in class UniAndGroupIterable<T1>
      Parameters:
      level - the concurrency level, must be strictly positive
      Returns:
      an object to configure the combination logic
    • combinedWith

      @Deprecated(forRemoval=true) @CheckReturnValue public <O> Uni<O> combinedWith(BiFunction<T1,T2,O> combinator)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use with(BiFunction) instead
      Creates the resulting Uni. The items are combined using the given combinator function.
      Type Parameters:
      O - the type of item
      Parameters:
      combinator - the combinator function, must not be null
      Returns:
      the resulting Uni<O>. The items are combined into UniAndGroup2
    • with

      @CheckReturnValue public <O> Uni<O> with(BiFunction<T1,T2,O> combinator)
      Creates the resulting Uni. The items are combined using the given combinator function.
      Type Parameters:
      O - the type of item
      Parameters:
      combinator - the combinator function, must not be null
      Returns:
      the resulting Uni<O>. The items are combined into UniAndGroup2
    • withUni

      @CheckReturnValue public <O> Uni<O> withUni(BiFunction<T1,T2,Uni<O>> combinator)
      Creates the resulting Uni. The items are combined using the given combinator function, and the resulting Uni<Uni<O>> is flattened.
      Type Parameters:
      O - the type of item
      Parameters:
      combinator - the combinator function, must not be null
      Returns:
      the resulting Uni. The items are combined into a Tuple2<T1, T2>.