mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #33210 from mastermatt/catbox/client-stop-async
[catbox] Update Client.stop() to return a promise.
This commit is contained in:
@@ -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');
|
||||
|
||||
Vendored
+1
-1
@@ -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]).
|
||||
|
||||
Reference in New Issue
Block a user