Skip to content

Commit f84ef49

Browse files
committed
Remove sleep in the buffer owing to fixing a bug in the pending race
1 parent af41766 commit f84ef49

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/AsyncIterables.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,6 @@ export const bufferingIterable = <T>(
302302
})
303303
);
304304
}
305-
306-
// this micro sleep stops thrashing
307-
await sleep(1);
308305
};
309306

310307
const nextReadyOne = async (): Promise<AsyncOptional<T> | undefined> => {
@@ -340,7 +337,7 @@ export const bufferingIterable = <T>(
340337
await queueMore();
341338

342339
if (pending.size) {
343-
await Promise.race(pending.keys());
340+
await Promise.race(pending.values());
344341
}
345342
}
346343

0 commit comments

Comments
 (0)