O - the outcome value type of the internal Function<P,R>.R - the return value type of the internal Function<P,R>.public class CompletionTranslator<O,R> extends Object
Completes<T> outcome by way of CompletesEventually.
Used by StateObjectQueryActor to provide answers from queries that complete asynchronously
to the original message delivery.| Modifier and Type | Method and Description |
|---|---|
void |
complete(O outcome)
Completes the outcome by executing the
Function<O,R> translator to produce the answer. |
static <O,R> CompletionTranslator<O,R> |
translatorOrNull(Function<O,R> translator,
CompletesEventually completes)
Answer a new instance of
CompletionSupplier<R> if the supplier is not null;
otherwise answer null. |
public static <O,R> CompletionTranslator<O,R> translatorOrNull(Function<O,R> translator, CompletesEventually completes)
CompletionSupplier<R> if the supplier is not null;
otherwise answer null.O - the outcome value type of the internal Function<P,R>.R - the return value type of the internal Function<P,R>.translator - the Function<P,R> of the eventual outcome, or null if none is providedcompletes - the CompletesEventually through which the eventual outcome is sentCompletionBiSupplier<O,R>public void complete(O outcome)
Function<O,R> translator to produce the answer.outcome - the O outcome to be translated into a completion valueCopyright © 2021. All rights reserved.