- All Known Implementing Classes:
AsyncCommand,CommandWrapper,TracedCommand,TransactionalCommand
public interface CompleteableCommand<T>
Extension to commands that provide registration of command completion callbacks. Completion callbacks allow execution of
tasks after successive, failed or any completion outcome. A callback must be non-blocking. Callback registration gives no
guarantee over callback ordering.
- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description voidonComplete(BiConsumer<? super T,Throwable> action)Register a command callback for command completion that notifies the callback with the command result or the failure resulting from command completion.voidonComplete(Consumer<? super T> action)Register a command callback for successive command completion that notifies the callback with the command result.
-
Method Details
-
onComplete
Register a command callback for successive command completion that notifies the callback with the command result.- Parameters:
action- must not benull.
-
onComplete
Register a command callback for command completion that notifies the callback with the command result or the failure resulting from command completion.- Parameters:
action- must not benull.
-