MCPcopy Create free account
hub / github.com/apache/groovy / whenComplete

Method whenComplete

src/main/java/groovy/concurrent/Awaitable.java:217–217  ·  view source on GitHub ↗

Returns a new Awaitable that invokes the given action when this computation completes, regardless of success or failure. The supplied throwable is transparently unwrapped so handlers see the original failure rather than ExecutionException / {@link java.util.concurrent.CompletionE

(BiConsumer<? super T, ? super Throwable> action)

Source from the content-addressed store, hash-verified

215 * @since 6.0.0
216 */
217 default Awaitable<T> whenComplete(BiConsumer<? super T, ? super Throwable> action) {
218 return GroovyPromise.of(toCompletableFuture().whenComplete((value, error) ->
219 action.accept(value, error == null ? null : AsyncSupport.unwrap(error))));
220 }

Callers 8

selectMethod · 0.80
sendMethod · 0.80
receiveMethod · 0.80
allAsyncMethod · 0.80
firstAsyncMethod · 0.80
orTimeoutMethod · 0.80
completeOnTimeoutMethod · 0.80
launchChildMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected