T - type of resultTError - type of errorpublic static interface AsyncSupplier.Listener<T,TError extends Exception>
| Modifier and Type | Method and Description |
|---|---|
void |
cancelled(CancelException event)
Called when the AsyncSupplier is unblocked by a cancellation.
|
void |
error(TError error)
Called when the AsyncSupplier is unblocked by an error.
|
static <T,TError extends Exception> |
from(Consumer<T> onReady,
Consumer<TError> onError,
Consumer<CancelException> onCancel)
Create a Listener with the given listeners.
|
static <T,TError extends Exception> |
from(Runnable onReady,
Consumer<TError> onError,
Consumer<CancelException> onCancel)
Create a Listener with the given listeners.
|
void |
ready(T result)
Called when the AsyncSupplier is unblocked with a result.
|
void ready(T result)
void error(TError error)
void cancelled(CancelException event)
static <T,TError extends Exception> AsyncSupplier.Listener<T,TError> from(Consumer<T> onReady, Consumer<TError> onError, Consumer<CancelException> onCancel)
static <T,TError extends Exception> AsyncSupplier.Listener<T,TError> from(Runnable onReady, Consumer<TError> onError, Consumer<CancelException> onCancel)
Copyright © 2019. All rights reserved.