QueuedClient should stop queuing calls once it has resolved
This commit is contained in:
parent
789d2df6e4
commit
ab44843b12
1 changed files with 12 additions and 2 deletions
|
@ -759,7 +759,12 @@ public final class Capability {
|
||||||
@Override
|
@Override
|
||||||
public Request<AnyPointer.Builder> newCall(long interfaceId, short methodId) {
|
public Request<AnyPointer.Builder> newCall(long interfaceId, short methodId) {
|
||||||
var hook = new LocalRequest(interfaceId, methodId, this);
|
var hook = new LocalRequest(interfaceId, methodId, this);
|
||||||
|
if (this.redirect == null) {
|
||||||
this.pendingCalls.add(hook);
|
this.pendingCalls.add(hook);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hook.releaseCall();
|
||||||
|
}
|
||||||
var root = hook.message.getRoot(AnyPointer.factory);
|
var root = hook.message.getRoot(AnyPointer.factory);
|
||||||
return newTypelessRequest(root, hook);
|
return newTypelessRequest(root, hook);
|
||||||
}
|
}
|
||||||
|
@ -767,7 +772,12 @@ 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>();
|
var promise = new CompletableFuture<ClientHook>();
|
||||||
|
if (this.redirect == null) {
|
||||||
this.queuedCalls.add(promise);
|
this.queuedCalls.add(promise);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
promise.complete(this.redirect);
|
||||||
|
}
|
||||||
|
|
||||||
var callResult = promise.thenApply(
|
var callResult = promise.thenApply(
|
||||||
client -> client.call(interfaceId, methodId, ctx));
|
client -> client.call(interfaceId, methodId, ctx));
|
||||||
|
|
Loading…
Reference in a new issue