Skip to content

Commit 8466c95

Browse files
committed
docstr
1 parent 97a4482 commit 8466c95

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ function now() {
3535
}
3636

3737
/**
38+
* CacheResource utilizes VSCode global states API to cache resources which are expensive to get so that the result can be shared across multiple VSCode instances.
39+
* The first VSCode instance invoking #getResource will hold a lock and make the actual network call/FS read to pull the real response.
40+
* When the pull is done, the lock will be released and it then caches the result in the global states. Then the rest of instances can now acquire the lock 1 by 1 and read the resource from the cache.
3841
* constructor:
3942
* @param key: global state key, which is used for globals.globalState#update, #tryGet etc.
4043
* @param expirationInMilli: cache expiration time in milli seconds

0 commit comments

Comments
 (0)