diff --git a/packages/grpc-js-core/src/channel.ts b/packages/grpc-js-core/src/channel.ts index e710b733e..44dcfae74 100644 --- a/packages/grpc-js-core/src/channel.ts +++ b/packages/grpc-js-core/src/channel.ts @@ -191,6 +191,7 @@ export class Http2Channel extends EventEmitter implements Channel { ConnectivityState.TRANSIENT_FAILURE); }; subChannel.once('close', this.subChannelCloseCallback); + subChannel.once('error', this.subChannelCloseCallback); } constructor( diff --git a/packages/grpc-js-core/src/index.ts b/packages/grpc-js-core/src/index.ts index 5a3f60251..95328f9c7 100644 --- a/packages/grpc-js-core/src/index.ts +++ b/packages/grpc-js-core/src/index.ts @@ -85,3 +85,8 @@ export { * @param client The client to close. */ export const closeClient = (client: Client) => client.close(); + +export const waitForClientReady = + (client: Client, deadline: Date|number, + callback: (error: Error|null) => void) => + client.waitForReady(deadline, callback);