Skip to content

Commit 58fa2ee

Browse files
aduh95sxa
authored andcommitted
stream: switch to internal sleep binding
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #63611 Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 02f35d6 commit 58fa2ee

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

‎lib/internal/streams/fast-utf8-stream.js‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66

77
const{
88
ArrayPrototypePush,
9-
AtomicsWait,
10-
Int32Array,
119
MathMax,
12-
Number,
1310
SymbolDispose,
1411
}=primordials;
1512

1613
const{
17-
constructSharedArrayBuffer,
14+
sleep,
1815
}=require('internal/util');
1916

2017
const{
@@ -50,22 +47,6 @@ const {
5047
constBUSY_WRITE_TIMEOUT=100;
5148
constkEmptyBuffer=Buffer.allocUnsafe(0);
5249

53-
constkNil=newInt32Array(constructSharedArrayBuffer(4));
54-
55-
functionsleep(ms){
56-
// Also filters out NaN, non-number types, including empty strings, but allows bigints
57-
constvalid=ms>0&&ms<Infinity;
58-
if(valid===false){
59-
if(typeofms!=='number'&&typeofms!=='bigint'){
60-
thrownewERR_INVALID_ARG_TYPE('ms',['number','bigint'],ms);
61-
}
62-
thrownewERR_INVALID_ARG_VALUE.RangeError('ms',ms,
63-
'must be a number greater than 0 and less than Infinity');
64-
}
65-
66-
AtomicsWait(kNil,0,0,Number(ms));
67-
}
68-
6950
// 16 KB. Don't write more than docker buffer size.
7051
// https://github.com/moby/moby/blob/513ec73831269947d38a644c278ce3cac36783b2/daemon/logger/copier.go#L13
7152
constkMaxWrite=16*1024;

0 commit comments

Comments
 (0)