You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/core/src/shared/utilities/resourceCache.ts
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,9 @@ function now() {
35
35
}
36
36
37
37
/**
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.
38
41
* constructor:
39
42
* @param key: global state key, which is used for globals.globalState#update, #tryGet etc.
40
43
* @param expirationInMilli: cache expiration time in milli seconds
0 commit comments