File tree Expand file tree Collapse file tree 3 files changed +0
-30
lines changed Expand file tree Collapse file tree 3 files changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,6 @@ class CrossRealmTransformReadableSource {
146146 error ) ;
147147 port . close ( ) ;
148148 } ;
149-
150- port . unref ( ) ;
151149 }
152150
153151 start ( controller ) {
@@ -221,7 +219,6 @@ class CrossRealmTransformWritableSink {
221219 port . close ( ) ;
222220 } ;
223221
224- port . unref ( ) ;
225222 }
226223
227224 start ( controller ) {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -454,23 +454,12 @@ const theData = 'hello';
454454 tracker.verify();
455455 });
456456
457- // We create an interval to keep the event loop alive while
458- // we wait for the stream read to complete. The reason this is needed is because there's
459- // otherwise nothing to keep the worker thread event loop alive long enough to actually
460- // complete the read from the stream. Under the covers the ReadableStream uses an
461- // unref'd MessagePort to communicate with the main thread. Because the MessagePort
462- // is unref'd, it's existence would not keep the thread alive on its own. There was previously
463- // a bug where this MessagePort was ref'd which would block the thread and main thread
464- // from terminating at all unless the stream was consumed/closed.
465- const i = setInterval(() => {}, 1000);
466-
467457 parentPort.onmessage = tracker.calls(({ data }) => {
468458 assert(isReadableStream(data));
469459 const reader = data.getReader();
470460 reader.read().then(tracker.calls((result) => {
471461 assert(!result.done);
472462 assert(result.value instanceof Uint8Array);
473- clearInterval(i);
474463 }));
475464 parentPort.close();
476465 });
You can’t perform that action at this time.
0 commit comments