Package cn.sliew.milky.common.filter
Interface ActionListener<Response>
-
- All Known Implementing Classes:
DelegatingActionListener
public interface ActionListener<Response>A listener for action responses or failures.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidonFailure(Throwable throwable)A failure caused by an exception at some phase of the task.voidonResponse(Response response)Handle action response.default BiConsumer<Response,Throwable>toBiConsumer()default CompletableFuture<Response>toFuture()static Runnablewrap(Runnable runnable, ActionListener listener)static <T> Callable<T>wrap(Callable<T> callable, ActionListener<T> listener)
-
-
-
Method Detail
-
onResponse
void onResponse(Response response)
Handle action response. This response may constitute a failure or a success but it is up to the listener to make that decision.
-
onFailure
void onFailure(Throwable throwable)
A failure caused by an exception at some phase of the task.
-
toFuture
default CompletableFuture<Response> toFuture()
-
toBiConsumer
default BiConsumer<Response,Throwable> toBiConsumer()
-
wrap
static Runnable wrap(Runnable runnable, ActionListener listener)
-
wrap
static <T> Callable<T> wrap(Callable<T> callable, ActionListener<T> listener)
-
-