Class UniJoin.JoinFirstStrategy<T>

java.lang.Object
io.smallrye.mutiny.groups.UniJoin.JoinFirstStrategy<T>
Type Parameters:
T - the type of the Uni values
All Implemented Interfaces:
UniJoin.JoinFirstStrategyTerminal<T>
Enclosing class:
UniJoin

public static class UniJoin.JoinFirstStrategy<T> extends Object implements UniJoin.JoinFirstStrategyTerminal<T>
Defines how to deal with failures while joining Uni references with UniJoin.first(List)}.
  • Method Details

    • usingConcurrencyOf

      @CheckReturnValue public UniJoin.JoinFirstStrategyTerminal<T> usingConcurrencyOf(int limit)
      Limit the number of concurrent upstream subscriptions.

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

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

      Parameters:
      limit - the concurrency limit, must be strictly positive
      Returns:
      an object to conclude the join strategy
    • toTerminate

      @CheckReturnValue public Uni<T> toTerminate()
      Forward the value or failure from the first Uni to terminate.
      Returns:
      a new Uni
    • withItem

      @CheckReturnValue public Uni<T> withItem()
      Forward the value from the first Uni to terminate with a value.

      When all Uni references fail then failures are collected into a CompositeException, which is then forwarded by the returned Uni.

      Specified by:
      withItem in interface UniJoin.JoinFirstStrategyTerminal<T>
      Returns:
      a new Uni