Interface MutinyFaultTolerance
-
public interface MutinyFaultToleranceContains factory methods forFaultTolerancewhere the type of value of the guarded action is a MutinyUni. These actions are always asynchronous and may be offloaded to another thread if necessary. In a modern reactive architecture, which is a typical use case for Mutiny, the actions are non-blocking and thread offload is not necessary.Note that
Uniis a lazy type, so the guarded actions are not called until the guardedUniis subscribed to.
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T> FaultTolerance.Builder<io.smallrye.mutiny.Uni<T>,FaultTolerance<io.smallrye.mutiny.Uni<T>>>create()Returns a builder that, at the end, returns aFaultToleranceobject representing a set of configured fault tolerance strategies.static <T> FaultTolerance.Builder<io.smallrye.mutiny.Uni<T>,Callable<io.smallrye.mutiny.Uni<T>>>createCallable(Callable<io.smallrye.mutiny.Uni<T>> action)Returns a builder that, at the end, returns aCallableguarding the givenaction.static <T> FaultTolerance.Builder<io.smallrye.mutiny.Uni<T>,Supplier<io.smallrye.mutiny.Uni<T>>>createSupplier(Supplier<io.smallrye.mutiny.Uni<T>> action)Returns a builder that, at the end, returns aSupplierguarding the givenaction.
-
-
-
Method Detail
-
createCallable
static <T> FaultTolerance.Builder<io.smallrye.mutiny.Uni<T>,Callable<io.smallrye.mutiny.Uni<T>>> createCallable(Callable<io.smallrye.mutiny.Uni<T>> action)
Returns a builder that, at the end, returns aCallableguarding the givenaction. Theactionis asynchronous and may be offloaded to another thread.Note that
Uniis a lazy type, so the action itself won't execute until theUniobtained from the resultingCallableis subscribed to.
-
createSupplier
static <T> FaultTolerance.Builder<io.smallrye.mutiny.Uni<T>,Supplier<io.smallrye.mutiny.Uni<T>>> createSupplier(Supplier<io.smallrye.mutiny.Uni<T>> action)
Returns a builder that, at the end, returns aSupplierguarding the givenaction. Theactionis asynchronous and may be offloaded to another thread.Note that
Uniis a lazy type, so the action itself won't execute until theUniobtained from the resultingSupplieris subscribed to.
-
create
static <T> FaultTolerance.Builder<io.smallrye.mutiny.Uni<T>,FaultTolerance<io.smallrye.mutiny.Uni<T>>> create()
Returns a builder that, at the end, returns aFaultToleranceobject representing a set of configured fault tolerance strategies. It can be used to execute asynchronous actions usingFaultTolerance.call(Callable)orFaultTolerance.get(Supplier).Note that
Uniis a lazy type, so the action itself won't execute until theUnireturned from thecallorgetmethods is subscribed to. For this reason, usingFaultTolerance.run(Runnable)doesn't make sense, because there's no way to obtain the resultingUnithat would need subscribing.This method usually has to be called with an explicitly provided type argument. For example:
MutinyFaultTolerance.<String>create().
-
-