Skip to content

Commit

Permalink
Add subchannel error handler, copy waitForReady wrapper from 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Apr 20, 2018
1 parent cad47e4 commit 0b075f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/grpc-js-core/src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 5 additions & 0 deletions packages/grpc-js-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 0b075f1

Please sign in to comment.