Interface CompletablePromise<V>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompletes this Promise with a value if not yet done.booleanCompletes this Promise with a an exception if not yet done.booleancompleteFrom(Promise<V> source) Completes or completes exceptionally this promise from the source promise when it becomes completed.Methods inherited from interface io.temporal.workflow.Promise
cancellableGet, cancellableGet, exceptionally, get, get, getFailure, handle, isCompleted, thenApply, thenCompose
-
Method Details
-
complete
Completes this Promise with a value if not yet done.- Returns:
- true if wasn't already completed.
-
completeExceptionally
Completes this Promise with a an exception if not yet done.- Returns:
- true if wasn't already completed.
-
completeFrom
Completes or completes exceptionally this promise from the source promise when it becomes completed.
Is shortcut to:destination.completeFrom(source);source.handle((value, failure) -> { if (failure != null) { destination.completeExceptionally(failure); } else { destination.complete(value); } return null; }- Parameters:
source- promise that is being watched.- Returns:
- false if source already completed, otherwise return true or null
-