Class UniMemoize<T>


  • public class UniMemoize<T>
    extends java.lang.Object
    • 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 to false.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 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

        @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 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