java.lang.Object
io.smallrye.mutiny.groups.UniOnTimeout<T>
-
Constructor Summary
ConstructorsConstructorDescriptionUniOnTimeout(Uni<T> upstream, Duration timeout, ScheduledExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionConfigures the timeout duration.fail()on(ScheduledExecutorService executor) Configures on which executor the timeout is measured.recoverWithItem(Supplier<T> supplier) recoverWithItem(T fallback) recoverWithUni(Uni<? extends T> fallback) recoverWithUni(Supplier<Uni<? extends T>> supplier)
-
Constructor Details
-
UniOnTimeout
-
-
Method Details
-
after
Configures the timeout duration.- Parameters:
timeout- the timeout, must not benull, must be strictly positive.- Returns:
- a new
UniOnTimeout
-
on
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
UniOnTimeout
-
fail
-
failWith
-
failWith
-
recoverWithItem
Produces a newUnifiring a fallback item when the currentUnithe upstreamUnido not emit an item before the timeout.The fallback item (potentially
null) is used as item by the producedUni.- Parameters:
fallback- the fallback value, may benull- Returns:
- the new
Uni
-
recoverWithItem
Produces a newUnifiring a fallback item supplied by the given supplier when the currentUnitimes out. The produced item (potentiallynull) is fired as item by the producedUni. Note that if the supplier throws an exception, the producedUniemits a failure.- Parameters:
supplier- the fallback supplier, may benull- Returns:
- the new
Uni
-
recoverWithUni
Produces a newUniproviding a fallbackUniwhen the currentUnitimes out. The fallback is produced using the given supplier, and it called when the failure is caught. The producedUniis used instead of the currentUni.- Parameters:
supplier- the fallback supplier, must not benull, must not producenull- Returns:
- the new
Uni
-
recoverWithUni
-