Skip to content

Commit

Permalink
fix: add close() in the wrapper (#986)
Browse files Browse the repository at this point in the history
* fix: add close in the wrapper

* fix format

* fix

* return one type

* simplify code

* clean up code
  • Loading branch information
mutianf authored Jan 18, 2022
1 parent 2169209 commit 839f429
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,16 @@ export class Bigtable {
}
}

/**
* Terminate grpc channels and close all the clients.
*/
close(): Promise<void[]> {
const combined = Object.keys(this.api).map(clientType =>
this.api[clientType].close()
);
return Promise.all(combined);
}

/**
* Determine and localize the project ID. If a user provides an ID, we bypass
* checking with the auth client for an ID.
Expand Down

0 comments on commit 839f429

Please sign in to comment.