stream.ts ×12

Frontier kind: Code frontier

unlabeled · c_83b3206c9ae6

668 tests · 5812 LOC · 29 files · introduces 0 tests · 35 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges35 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
830 ranges5812 lines · 29 files · Browse complete extent
All tests (intent)
668 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.

1 file ranked by introduced lines: 35 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/stream.ts 35 introduced LOC · 12 ranges

Open complete file

239
240 resume(): void {
241 > if (this.state.destroyed) { stream.ts
242 return;
243 }
244 > stream.ts
245 > if (!this.state.flowing) {
246 > this.state.flowing = true;
247 >
248 > // emit buffered events
249 > this.flowData();
250 > this.flowErrors();
251 > this.flowEnd();
252 > }
253 > }
254
255 write(data: T): void | Promise<void> {
333 on(event: 'end', callback: () => void): void;
334 on(event: 'data' | 'error' | 'end', callback: ((data: T) => void) | ((err: Error) => void) | (() => void)): void {
335 > if (this.state.destroyed) { stream.ts
336 return;
337 }
338 > stream.ts
339 > switch (event) {
340 > case 'data':
341 > this.listeners.data.push(callback as (data: T) => void);
342 >
343 > // switch into flowing mode as soon as the first 'data'
344 > // listener is added and we are not yet in flowing mode
345 > this.resume();
346 >
347 > break;
348 >
349 > case 'end':
350 this.listeners.end.push(callback as () => void);
351
359
360 break;
361 > stream.ts
362 > case 'error':
363 this.listeners.error.push(callback as (err: Error) => void);
364
370
371 break;
372 > } stream.ts
373 > }
374
375 removeListener(event: string, callback: Function): void {
403
404 private flowData(): void {
405 > // if buffer is empty, nothing to do stream.ts
406 > if (this.buffer.data.length === 0) {
407 return;
408 }
427 this.pendingWritePromises.length = 0;
428 pendingWritePromises.forEach(pendingWritePromise => pendingWritePromise());
429 > } stream.ts
430
431 private flowErrors(): void {
432 > if (this.listeners.error.length > 0) { stream.ts
433 for (const error of this.buffer.error) {
434 this.emitError(error);
437 this.buffer.error.length = 0;
438 }
439 > } stream.ts
440
441 private flowEnd(): boolean {
442 > if (this.state.ended) { stream.ts
443 this.emitEnd();
444
447
448 return false;
449 > } stream.ts
450
451 destroy(): void {