feat: promisify session cache methods (#17185)

This commit is contained in:
Shelley Vohr 2019-03-08 14:42:03 -08:00 committed by GitHub
parent 652e232813
commit fc10620082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 17 deletions

View file

@ -97,12 +97,28 @@ The following methods are available on instances of `Session`:
* `callback` Function
* `size` Integer - Cache size used in bytes.
* `error` Integer - The error code corresponding to the failure.
Callback is invoked with the session's current cache size.
**[Deprecated Soon](promisification.md)**
#### `ses.getCacheSize()`
Returns `Promise<Integer>` - the session's current cache size, in bytes.
#### `ses.clearCache(callback)`
* `callback` Function - Called when operation is done.
* `error` Integer - The error code corresponding to the failure.
Clears the sessions HTTP cache.
**[Deprecated Soon](promisification.md)**
#### `ses.clearCache()`
Returns `Promise<void>` - resolves when the cache clear operation is complete.
Clears the sessions HTTP cache.