mirror of https://github.com/grpc/grpc-node.git
grpc-js: exitIdle asynchronously in QueuePicker, only act in exitIdle if IDLE
This commit is contained in:
parent
58345b60f1
commit
a23f739e5f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@grpc/grpc-js",
|
"name": "@grpc/grpc-js",
|
||||||
"version": "0.6.3",
|
"version": "0.6.4",
|
||||||
"description": "gRPC Library for Node - pure JS implementation",
|
"description": "gRPC Library for Node - pure JS implementation",
|
||||||
"homepage": "https://grpc.io/",
|
"homepage": "https://grpc.io/",
|
||||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||||
|
|
|
@ -113,7 +113,9 @@ export class QueuePicker {
|
||||||
|
|
||||||
pick(pickArgs: PickArgs): QueuePickResult {
|
pick(pickArgs: PickArgs): QueuePickResult {
|
||||||
if (!this.calledExitIdle) {
|
if (!this.calledExitIdle) {
|
||||||
this.loadBalancer.exitIdle();
|
process.nextTick(() => {
|
||||||
|
this.loadBalancer.exitIdle();
|
||||||
|
});
|
||||||
this.calledExitIdle = true;
|
this.calledExitIdle = true;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -331,14 +331,16 @@ export class ResolvingLoadBalancer implements LoadBalancer {
|
||||||
}
|
}
|
||||||
|
|
||||||
exitIdle() {
|
exitIdle() {
|
||||||
this.innerResolver.updateResolution();
|
|
||||||
if (this.innerLoadBalancer !== null) {
|
if (this.innerLoadBalancer !== null) {
|
||||||
this.innerLoadBalancer.exitIdle();
|
this.innerLoadBalancer.exitIdle();
|
||||||
}
|
}
|
||||||
this.channelControlHelper.updateState(
|
if (this.currentState === ConnectivityState.IDLE) {
|
||||||
ConnectivityState.CONNECTING,
|
this.innerResolver.updateResolution();
|
||||||
new QueuePicker(this)
|
this.updateState(
|
||||||
);
|
ConnectivityState.CONNECTING,
|
||||||
|
new QueuePicker(this)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAddressList(
|
updateAddressList(
|
||||||
|
|
Loading…
Reference in New Issue