Package io.smallrye.mutiny.groups
Class MultiOnItemTimeout<T>
- java.lang.Object
-
- io.smallrye.mutiny.groups.MultiOnItemTimeout<T>
-
@Experimental("Multi timeouts are an experimental feature.") public class MultiOnItemTimeout<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MultiOnItemTimeout(Multi<T> upstream, java.time.Duration timeout, java.util.concurrent.ScheduledExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Multi<T>fail()Multi<T>failWith(java.lang.Throwable failure)Multi<T>failWith(java.util.function.Supplier<? extends java.lang.Throwable> supplier)MultiOnItemTimeout<T>on(java.util.concurrent.ScheduledExecutorService executor)Configures on which executor the timeout is measured.Multi<T>recoverWithCompletion()Multi<T>recoverWithMulti(Multi<? extends T> fallback)Multi<T>recoverWithMulti(java.util.function.Supplier<Multi<? extends T>> supplier)
-
-
-
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 theTimeoutfailure event.- Parameters:
executor- the executor to use, must not benull- Returns:
- a new
MultiOnItemTimeout
-
failWith
@CheckReturnValue public Multi<T> failWith(java.util.function.Supplier<? extends java.lang.Throwable> supplier)
-
recoverWithCompletion
@CheckReturnValue public Multi<T> recoverWithCompletion()
Produces a newMultifiring a completion when the currentMultidoes 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 newMultiproviding a fallbackMultiwhen the currentMultitimes out. The fallback is produced using the given supplier, and is called when the failure is caught. The producedMultiis used instead of the currentMulti.- Parameters:
supplier- the fallback supplier, must not benull, must not producenull- Returns:
- the new
Multi
-
-