Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 839f429

Browse files
authored
fix: add close() in the wrapper (#986)
* fix: add close in the wrapper * fix format * fix * return one type * simplify code * clean up code
1 parent 2169209 commit 839f429

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,16 @@ export class Bigtable {
883883
}
884884
}
885885

886+
/**
887+
* Terminate grpc channels and close all the clients.
888+
*/
889+
close(): Promise<void[]> {
890+
const combined = Object.keys(this.api).map(clientType =>
891+
this.api[clientType].close()
892+
);
893+
return Promise.all(combined);
894+
}
895+
886896
/**
887897
* Determine and localize the project ID. If a user provides an ID, we bypass
888898
* checking with the auth client for an ID.

0 commit comments

Comments
 (0)