GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: switch to internal `sleep` binding · nodejs/node@58fa2ee

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/streams
    • fast-utf8-stream.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: lib/internal/streams/fast-utf8-stream.js
+1-20Lines 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
const BUSY_WRITE_TIMEOUT = 100;
5148
const kEmptyBuffer = Buffer.allocUnsafe(0);
5249

53-
const kNil = new Int32Array(constructSharedArrayBuffer(4));
54-
55-
function sleep(ms) {
56-
// Also filters out NaN, non-number types, including empty strings, but allows bigints
57-
const valid = ms > 0 && ms < Infinity;
58-
if (valid === false) {
59-
if (typeof ms !== 'number' && typeof ms !== 'bigint') {
60-
throw new ERR_INVALID_ARG_TYPE('ms', ['number', 'bigint'], ms);
61-
}
62-
throw new ERR_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
const kMaxWrite = 16 * 1024;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.