Package io.temporal.workflow
Interface CompletablePromise<V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
complete(V value)
Completes this Promise with a value if not yet done.boolean
completeExceptionally(java.lang.RuntimeException value)
Completes this Promise with a an exception if not yet done.boolean
completeFrom(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 Detail
-
complete
boolean complete(V value)
Completes this Promise with a value if not yet done.- Returns:
- true if wasn't already completed.
-
completeExceptionally
boolean completeExceptionally(java.lang.RuntimeException value)
Completes this Promise with a an exception if not yet done.- Returns:
- true if wasn't already completed.
-
completeFrom
boolean completeFrom(Promise<V> source)
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
-
-