File tree 3 files changed +0
-30
lines changed
3 files changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,6 @@ class CrossRealmTransformReadableSource {
146
146
error ) ;
147
147
port . close ( ) ;
148
148
} ;
149
-
150
- port . unref ( ) ;
151
149
}
152
150
153
151
start ( controller ) {
@@ -221,7 +219,6 @@ class CrossRealmTransformWritableSink {
221
219
port . close ( ) ;
222
220
} ;
223
221
224
- port . unref ( ) ;
225
222
}
226
223
227
224
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';
454
454
tracker.verify();
455
455
});
456
456
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
-
467
457
parentPort.onmessage = tracker.calls(({ data }) => {
468
458
assert(isReadableStream(data));
469
459
const reader = data.getReader();
470
460
reader.read().then(tracker.calls((result) => {
471
461
assert(!result.done);
472
462
assert(result.value instanceof Uint8Array);
473
- clearInterval(i);
474
463
}));
475
464
parentPort.close();
476
465
});
You can’t perform that action at this time.
0 commit comments