public final class TimeoutMethodUtils extends Object
AbstractToolingRequest operation and abort if the configuration timeout
is reached before the operation is completed.| Constructor and Description |
|---|
TimeoutMethodUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
withTimeout(long timeout,
Supplier<T> resultSupplier,
Function<Throwable,? extends T> throwableTFunction)
Evalues the resultSupplier provided for the given timeout defined for the request, if the operation
is not completed before timeout is reached a
TimeoutException is thrown. |
public static <T> T withTimeout(long timeout,
Supplier<T> resultSupplier,
Function<Throwable,? extends T> throwableTFunction)
TimeoutException is thrown. In case of errors during the operation
a function is provided for handling them properly.T - the type of the operation result.timeout - the request operation timeout in milliseconds. -1 means no timeout block until it gets the response.resultSupplier - the function that evaluates the operation and returns the result. Not null.throwableTFunction - in case if the operation throws an exception a function to handle it can be passed. Can be null.Copyright © 2017 MuleSoft, Inc.. All rights reserved.