Skip to content

Commit d52d659

Browse files
committed
docstr
1 parent 33dd9bf commit d52d659

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

packages/core/src/shared/utilities/resourceCache.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import { getLogger } from '../logger/logger'
99
import { waitUntil } from '../utilities/timeoutUtils'
1010

1111
/**
12-
* result: the actual resource type callers want to use
13-
* locked: readWriteLock, while the lock is acquired by one process, the other can't access to it until it's released by the previous
14-
* timestamp: used for determining the resource is stale or not
12+
* args:
13+
* [result]: the actual resource type callers want to use
14+
* [locked]: readWriteLock, while the lock is acquired by one process, the other can't access to it until it's released by the previous
15+
* [timestamp]: used for determining the resource is stale or not
1516
*/
1617
interface Resource<V> {
1718
result: V | undefined
@@ -35,14 +36,14 @@ function now() {
3536

3637
/**
3738
* args:
38-
* key: global state key, which is used for globals.globalState#update, #tryGet etc.
39-
* expirationInMilli: cache expiration time in milli seconds
40-
* defaultValue: default value for the cache if the cache doesn't pre-exist in users' FS
41-
* waitUntilOption: waitUntil option for acquire lock
39+
* [key]: global state key, which is used for globals.globalState#update, #tryGet etc.
40+
* [expirationInMilli]: cache expiration time in milli seconds
41+
* [defaultValue]: default value for the cache if the cache doesn't pre-exist in users' FS
42+
* [waitUntilOption]: waitUntil option for acquire lock
4243
*
4344
* methods:
44-
* resourceProvider(): implementation needs to implement this method to obtain the latest resource either via network calls or FS read
45-
* getResource(): obtain the resource from cache or pull the latest from the service if the cache either expires or doesn't exist
45+
* #resourceProvider: implementation needs to implement this method to obtain the latest resource either via network calls or FS read
46+
* #getResource: obtain the resource from cache or pull the latest from the service if the cache either expires or doesn't exist
4647
*/
4748
export abstract class CachedResource<V> {
4849
constructor(

0 commit comments

Comments
 (0)