Class UniMemoize<T>

java.lang.Object
io.smallrye.mutiny.groups.UniMemoize<T>

public class UniMemoize<T> extends Object
  • Constructor Details

  • Method Details

    • until

      @CheckReturnValue public Uni<T> until(BooleanSupplier invalidationGuard)
      Memoize the received item or failure as long as the provided boolean supplier evaluates to false.

      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 to false for as long as the item or failure must be memoized, must not be null
      Returns:
      a new Uni
    • atLeast

      @Deprecated(forRemoval=true) @CheckReturnValue public Uni<T> atLeast(Duration duration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 be null, must be strictly positive
      Returns:
      a new Uni
    • forFixedDuration

      @CheckReturnValue public Uni<T> forFixedDuration(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 be null, must be strictly positive
      Returns:
      a new Uni
    • indefinitely

      @CheckReturnValue public Uni<T> indefinitely()
      Memoize the received item or failure indefinitely.
      API Note:
      This is an experimental API
      Returns:
      a new Uni