Class UniJoin.JoinAllStrategy<T>

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

public static class UniJoin.JoinAllStrategy<T> extends Object implements UniJoin.JoinAllStrategyTerminal<T>
Defines how to deal with failures while joining Uni references with UniJoin.all(List).
  • Method Details

    • usingConcurrencyOf

      @CheckReturnValue public UniJoin.JoinAllStrategyTerminal<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
    • andCollectFailures

      @CheckReturnValue public Uni<List<T>> andCollectFailures()
      Wait for all Uni references to terminate, and collect all failures in a CompositeException.
      Specified by:
      andCollectFailures in interface UniJoin.JoinAllStrategyTerminal<T>
      Returns:
      a new Uni
    • andFailFast

      @CheckReturnValue public Uni<List<T>> andFailFast()
      Immediately forward the first failure from any of the Uni, and cancel the remaining Uni subscriptions, ignoring eventual subsequent failures.
      Specified by:
      andFailFast in interface UniJoin.JoinAllStrategyTerminal<T>
      Returns:
      a new Uni