public class ResponseExecution extends Object
| Constructor and Description |
|---|
ResponseExecution() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
createResponse(String methodId,
int retry,
long timeout,
long circuitBreakerTimeout,
ThrowableFutureConsumer<T> userOperation,
java.util.function.Consumer<Throwable> errorHandler,
ThrowableErrorConsumer<Throwable,T> onFailureRespond,
java.util.function.Consumer<Throwable> errorMethodHandler,
VxmsShared vxmsShared,
Throwable failure,
java.util.function.Consumer<ExecutionResult<T>> resultConsumer)
Executes the response creation and handles failures
|
static Optional<?> |
encode(Serializable value,
Encoder encoder) |
static void |
handleError(java.util.function.Consumer<Throwable> errorHandler,
Throwable e) |
public static <T> void createResponse(String methodId, int retry, long timeout, long circuitBreakerTimeout, ThrowableFutureConsumer<T> userOperation, java.util.function.Consumer<Throwable> errorHandler, ThrowableErrorConsumer<Throwable,T> onFailureRespond, java.util.function.Consumer<Throwable> errorMethodHandler, VxmsShared vxmsShared, Throwable failure, java.util.function.Consumer<ExecutionResult<T>> resultConsumer)
T - the type of responsemethodId - the method name/id to be executedretry - the amount of retriestimeout - the max timeout time for the method executioncircuitBreakerTimeout - the stateful circuit breaker release timeuserOperation - the operation to execute, defined in fluent APIerrorHandler - the intermediate error method, executed on each erroronFailureRespond - the method to be executed on failureerrorMethodHandler - the fallback methodvxmsShared - the vxmsShared instance, containing the Vertx instance and other shared
objects per instancefailure - last thrown ExceptionresultConsumer - the consumer that takes the execution resultzpublic static void handleError(java.util.function.Consumer<Throwable> errorHandler, Throwable e)
public static Optional<?> encode(Serializable value, Encoder encoder)
Copyright © 2017. All rights reserved.