Class MultiOnItemTimeout<T>


  • public class MultiOnItemTimeout<T>
    extends java.lang.Object
    • Constructor Detail

      • MultiOnItemTimeout

        public MultiOnItemTimeout​(Multi<T> upstream,
                                  java.time.Duration timeout,
                                  java.util.concurrent.ScheduledExecutorService executor)
    • Method Detail

      • on

        public MultiOnItemTimeout<T> on​(java.util.concurrent.ScheduledExecutorService executor)
        Configures on which executor the timeout is measured. Note that this executor is also going to be used to fire the Timeout failure event.
        Parameters:
        executor - the executor to use, must not be null
        Returns:
        a new MultiOnItemTimeout
      • fail

        @CheckReturnValue
        public Multi<T> fail()
      • failWith

        @CheckReturnValue
        public Multi<T> failWith​(java.lang.Throwable failure)
      • failWith

        @CheckReturnValue
        public Multi<T> failWith​(java.util.function.Supplier<? extends java.lang.Throwable> supplier)
      • recoverWithCompletion

        @CheckReturnValue
        public Multi<T> recoverWithCompletion()
        Produces a new Multi firing a completion when the current Multi does not emit an item before the timeout.
        Returns:
        the new Multi
      • recoverWithMulti

        @CheckReturnValue
        public Multi<T> recoverWithMulti​(java.util.function.Supplier<Multi<? extends T>> supplier)
        Produces a new Multi providing a fallback Multi when the current Multi times out. The fallback is produced using the given supplier, and is called when the failure is caught. The produced Multi is used instead of the current Multi.
        Parameters:
        supplier - the fallback supplier, must not be null, must not produce null
        Returns:
        the new Multi
      • recoverWithMulti

        @CheckReturnValue
        public Multi<T> recoverWithMulti​(Multi<? extends T> fallback)
        Produces a new Multi providing a fallback Multi when the current Multi times out. The fallback Multi is used instead of the current Multi.
        Parameters:
        fallback - the fallback Multi, must not be null
        Returns:
        the new Multi