make direct call if QueuedClient has resolved
This commit is contained in:
parent
3b1f5f416c
commit
53eeed97e2
1 changed files with 4 additions and 6 deletions
|
@ -782,18 +782,16 @@ public final class Capability {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) {
|
public VoidPromiseAndPipeline call(long interfaceId, short methodId, CallContextHook ctx) {
|
||||||
var promise = new CompletableFuture<ClientHook>();
|
if (this.redirect != null) {
|
||||||
if (this.redirect == null) {
|
return this.redirect.call(interfaceId, methodId, ctx);
|
||||||
this.queuedCalls.add(promise);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
promise.complete(this.redirect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var promise = new CompletableFuture<ClientHook>();
|
||||||
var callResult = promise.thenApply(
|
var callResult = promise.thenApply(
|
||||||
client -> client.call(interfaceId, methodId, ctx));
|
client -> client.call(interfaceId, methodId, ctx));
|
||||||
var pipelineResult = callResult.thenApply(result -> result.pipeline);
|
var pipelineResult = callResult.thenApply(result -> result.pipeline);
|
||||||
var pipeline = new QueuedPipeline(pipelineResult);
|
var pipeline = new QueuedPipeline(pipelineResult);
|
||||||
|
this.queuedCalls.add(promise);
|
||||||
return new VoidPromiseAndPipeline(pipelineResult.thenRun(() -> {}), pipeline);
|
return new VoidPromiseAndPipeline(pipelineResult.thenRun(() -> {}), pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue