diff --git a/src/IMultiRegionCacheWriterClient.ts b/src/IMultiRegionCacheWriterClient.ts index c2f8cbb..c9e43e9 100644 --- a/src/IMultiRegionCacheWriterClient.ts +++ b/src/IMultiRegionCacheWriterClient.ts @@ -54,4 +54,6 @@ export interface IMultiRegionCacheWriterClient { | Array<[string, number]>, options?: SortedSetPutElementsOptions ): Promise; + + close(): void; } diff --git a/src/multi-region-cache-writer-client.ts b/src/multi-region-cache-writer-client.ts index c657be4..bd8ec1a 100644 --- a/src/multi-region-cache-writer-client.ts +++ b/src/multi-region-cache-writer-client.ts @@ -172,6 +172,15 @@ export class MultiRegionCacheWriterClient public get configuration(): Configuration { return this._configuration; } + + /** + * Closes all the enclosed cache clients. + */ + public close(): void { + for (const client of Object.values(this.clients)) { + client.close(); + } + } } function getDefaultCacheClientConfiguration(): Configuration {