2020-10-06 16:44:54 +00:00
|
|
|
package org.capnproto;
|
|
|
|
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
public final class DispatchCallResult {
|
|
|
|
|
2020-10-20 20:42:20 +00:00
|
|
|
private final CompletableFuture<java.lang.Void> promise;
|
2020-10-06 16:44:54 +00:00
|
|
|
private final boolean streaming;
|
|
|
|
|
2020-10-20 20:42:20 +00:00
|
|
|
public DispatchCallResult(CompletableFuture<java.lang.Void> promise, boolean isStreaming) {
|
2020-10-06 16:44:54 +00:00
|
|
|
this.promise = promise;
|
|
|
|
this.streaming = isStreaming;
|
|
|
|
}
|
|
|
|
|
|
|
|
public DispatchCallResult(Throwable exc) {
|
|
|
|
this(CompletableFuture.failedFuture(exc), false);
|
|
|
|
}
|
|
|
|
|
2020-10-20 20:42:20 +00:00
|
|
|
public CompletableFuture<java.lang.Void> getPromise() {
|
|
|
|
return promise.copy();
|
2020-10-06 16:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isStreaming() {
|
|
|
|
return streaming;
|
|
|
|
}
|
|
|
|
}
|