We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae53ee7 commit 7a8aa8aCopy full SHA for 7a8aa8a
1 file changed
lib/internal/blob.js
@@ -476,16 +476,14 @@ function createBlobReaderStream(reader) {
476
// Lazily register a wakeup callback that the C++ side can invoke
477
// when new data is available after a STATUS_BLOCK.
478
let immediate;
479
- reader.setWakeup(() => {
480
- if (this.pendingPulls.length > 0 &&
481
- typeof immediate === 'undefined') {
482
- // Postpone the execution to the next steps of the event loop
483
- immediate = setImmediate(() => {
+ this.wakeup = () => {
+ if (this.pendingPulls.length > 0) {
+ immediate ??= setImmediate(() => {
484
immediate = undefined;
485
this.readNext(c);
486
});
487
}
488
- });
+ };
489
},
490
pull(c) {
491
const { promise, resolve, reject } = PromiseWithResolvers();
0 commit comments