- java.lang.Object
-
- io.smallrye.mutiny.groups.UniMemoize<T>
-
public class UniMemoize<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description UniMemoize(AbstractUni<T> upstream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Uni<T>
atLeast(java.time.Duration duration)
Memoize the received item or failure for a duration after the upstream subscription has been received.Uni<T>
indefinitely()
Memoize the received item or failure indefinitely.Uni<T>
until(java.util.function.BooleanSupplier invalidationGuard)
Memoize the received item or failure as long as the provided boolean supplier evaluates tofalse
.
-
-
-
Constructor Detail
-
UniMemoize
public UniMemoize(AbstractUni<T> upstream)
-
-
Method Detail
-
until
@CheckReturnValue public Uni<T> until(java.util.function.BooleanSupplier invalidationGuard)
Memoize the received item or failure as long as the provided boolean supplier evaluates tofalse
.New subscribers will receive the memoized item or failure. When the boolean supplier evaluates to
true
then a new upstream subscription happens and the next subscribers get a chance to observe new values.- API Note:
- This is an experimental API
- Parameters:
invalidationGuard
- the invalidation guard, which evaluates tofalse
for as long as the item or failure must be memoized, must not benull
- Returns:
- a new
Uni
-
atLeast
@CheckReturnValue public Uni<T> atLeast(java.time.Duration duration)
Memoize the received item or failure for a duration after the upstream subscription has been received.New subscribers will receive the memoized item or failure. When duration has elapsed then the first subscription causes a new upstream subscription, and the next subscribers get a chance to observe new values.
- API Note:
- This is an experimental API
- Parameters:
duration
- the memoization duration after having received the subscription from upstream, must not benull
, must be strictly positive- Returns:
- a new
Uni
-
-