- java.lang.Object
-
- io.smallrye.mutiny.groups.UniJoin.JoinFirstStrategy<T>
-
- Type Parameters:
T- the type of theUnivalues
- All Implemented Interfaces:
UniJoin.JoinFirstStrategyTerminal<T>
- Enclosing class:
- UniJoin
public static class UniJoin.JoinFirstStrategy<T> extends java.lang.Object implements UniJoin.JoinFirstStrategyTerminal<T>
Defines how to deal with failures while joiningUnireferences withUniJoin.first(List)}.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Uni<T>toTerminate()Forward the value or failure from the firstUnito terminate.UniJoin.JoinFirstStrategyTerminal<T>usingConcurrencyOf(int limit)Limit the number of concurrent upstream subscriptions.Uni<T>withItem()Forward the value from the firstUnito terminate with a value.
-
-
-
Method Detail
-
usingConcurrencyOf
@CheckReturnValue public UniJoin.JoinFirstStrategyTerminal<T> usingConcurrencyOf(int limit)
Limit the number of concurrent upstream subscriptions.When not specified all upstream
Uniare being subscribed when the joiningUniis subscribed.Setting a limit is useful when you have a large number of
Unito 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 firstUnito terminate.- Returns:
- a new
Uni
-
withItem
@CheckReturnValue public Uni<T> withItem()
Forward the value from the firstUnito terminate with a value.When all
Unireferences fail then failures are collected into aCompositeException, which is then forwarded by the returnedUni.- Specified by:
withItemin interfaceUniJoin.JoinFirstStrategyTerminal<T>- Returns:
- a new
Uni
-
-