async.ts ×5

Frontier kind: Code frontier

unlabeled · c_526a7a8174aa

1006 tests · 7276 LOC · 31 files · introduces 0 tests · 39 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges39 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1129 ranges7276 lines · 31 files · Browse complete extent
All tests (intent)
1006 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 39 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/async.ts 37 introduced LOC · 5 ranges

Open complete file

932
933 private isDrained(): boolean {
934 > for (const [, queue] of this.queues) { async.ts
935 if (queue.size > 0) {
936 return false;
937 }
938 }
939 > async.ts
940 > return true;
941 > }
942
943 queueSize(resource: URI, extUri: IExtUri = defaultExtUri): number {
948
949 queueFor(resource: URI, factory: ITask<Promise<void>>, extUri: IExtUri = defaultExtUri): Promise<void> {
950 > const key = extUri.getComparisonKey(resource); async.ts
951 >
952 > let queue = this.queues.get(key);
953 > if (!queue) {
954 > queue = new Queue<void>();
955 > const drainListenerId = this.drainListenerCount++;
956 > const drainListener = Event.once(queue.onDrained)(() => {
957 > queue?.dispose();
958 > this.queues.delete(key);
959 > this.onDidQueueDrain();
960 >
961 > this.drainListeners?.deleteAndDispose(drainListenerId);
962 >
963 > if (this.drainListeners?.size === 0) {
964 > this.drainListeners.dispose();
965 > this.drainListeners = undefined;
966 > }
967 > });
968 >
969 > if (!this.drainListeners) {
970 > this.drainListeners = new DisposableMap();
971 > }
972 > this.drainListeners.set(drainListenerId, drainListener);
973 >
974 > this.queues.set(key, queue);
975 > }
976 >
977 > return queue.queue(factory);
978 > }
979
980 private onDidQueueDrain(): void {
981 > if (!this.isDrained()) { async.ts
982 return; // not done yet
983 }
984 > async.ts
985 > this.releaseDrainers();
986 > }
987
988 private releaseDrainers(): void {
src/vs/base/common/lifecycle.ts 2 introduced LOC · 1 range

Open complete file

796
797 get size(): number {
798 > return this._store.size; lifecycle.ts
799 > }
800
801 get(key: K): V | undefined {