Merge pull request #33210 from mastermatt/catbox/client-stop-async

[catbox] Update Client.stop() to return a promise.
This commit is contained in:
Andrew Casey
2019-02-19 17:25:29 -08:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -18,6 +18,9 @@ const Memory: EnginePrototypeOrObject = {
const client = new Client<string>(Memory, { partition: 'cache' });
client.start().then(() => {});
client.stop().then(() => {});
const cache = new Policy({
expiresIn: 5000,
}, client, 'cache');
+1 -1
View File
@@ -23,7 +23,7 @@ export class Client<T> implements ClientApi<T> {
/** start() - creates a connection to the cache server. Must be called before any other method is available. */
start(): Promise<void>;
/** stop() - terminates the connection to the cache server. */
stop(): void;
stop(): Promise<void>;
/**
* get(key, callback) - retrieve an item from the cache engine if found where:
* * key - a cache key object (see [ICacheKey]).