@nxtedition/yield 1.0.18 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,16 +34,17 @@ for (const row of db.prepare('SELECT * FROM large_table').iterate()) {
34
34
  ### Callback-based
35
35
 
36
36
  ```js
37
- import { maybeYield } from '@nxtedition/yield'
37
+ import { shouldYield, doYield } from '@nxtedition/yield'
38
38
  import fs from 'node:fs'
39
39
 
40
40
  function processFiles(files, i = 0) {
41
41
  for (; i < files.length; i++) {
42
+ if (shouldYield()) {
43
+ doYield((index) => processFiles(files, index), i)
44
+ return // resumes at index i after the event loop has had a turn
45
+ }
42
46
  const data = fs.readFileSync(files[i])
43
47
  transform(data)
44
- if (maybeYield(processFiles, files, i + 1)) {
45
- return // will resume via callback after yielding
46
- }
47
48
  }
48
49
  }
49
50
  ```
@@ -65,14 +66,13 @@ doYield((opaque) => {
65
66
  ### Checking without yielding
66
67
 
67
68
  ```js
68
- import { shouldYield, doYield } from '@nxtedition/yield'
69
+ import { shouldYield } from '@nxtedition/yield'
69
70
 
70
71
  while (hasWork()) {
71
- doWork()
72
72
  if (shouldYield()) {
73
- doMoreWork()
74
- break
73
+ break // pick the remaining work back up on a later turn
75
74
  }
75
+ doWork()
76
76
  }
77
77
  ```
78
78
 
@@ -80,7 +80,9 @@ while (hasWork()) {
80
80
 
81
81
  ### `shouldYield(timeout?): boolean`
82
82
 
83
- Returns `true` when the current synchronous execution has exceeded the timeout threshold (default: 40ms). Does not yield — only checks whether yielding is recommended.
83
+ Returns `true` when more than `timeout` milliseconds (default: 40) have elapsed since the last yield dispatch. Does not yield — only checks whether yielding is recommended.
84
+
85
+ Once it returns `true` it latches and keeps returning `true` until the pending yield dispatch has run. When it latches, a dispatch is scheduled automatically, so the latch clears after the next event-loop turn even if the caller never enqueues a yield.
84
86
 
85
87
  ### `maybeYield(timeout?): Promise<void> | null`
86
88
 
@@ -90,6 +92,8 @@ If a yield is needed, queues a yield and returns a `Promise`. Otherwise returns
90
92
 
91
93
  If a yield is needed, defers `callback(opaque)` to after the yield. Otherwise calls `callback(opaque)` synchronously.
92
94
 
95
+ Note: because the no-yield path invokes the callback synchronously, a recursive continuation-passing loop built on this overload grows the stack until the timeout elapses. For long loops prefer the `shouldYield()`/`doYield()` pattern shown above.
96
+
93
97
  ### `doYield(): Promise<void>`
94
98
 
95
99
  Unconditionally queues a yield and returns a `Promise` that resolves after the event loop has been given a turn.
@@ -100,15 +104,15 @@ Unconditionally defers `callback(opaque)` to after the next yield.
100
104
 
101
105
  ### `setYieldTimeout(timeout): void`
102
106
 
103
- Set the default yield timeout in milliseconds. Must be a non-negative number. Default: `40`.
107
+ Set the default yield timeout in milliseconds. Must be a non-negative number (`NaN` is rejected; `Infinity` disables time-based yielding). Default: `40`.
104
108
 
105
109
  ### `setYieldDispatcher(dispatcher): void`
106
110
 
107
- Override the scheduling function used to defer work. The dispatcher receives a callback and should invoke it asynchronously (e.g. via `setTimeout` or `setImmediate`). Pass `null` to restore the default dispatcher.
111
+ Override the scheduling function used to defer work. The dispatcher receives a callback and should invoke it asynchronously (e.g. via `setTimeout` or `setImmediate`) — asynchronous invocation is what actually gives the event loop a turn. A dispatcher that invokes the callback synchronously is tolerated and loses no queued items, but it defeats the purpose of yielding. Pass `null` (or `undefined`) to restore the default dispatcher. Throws a `TypeError` for any other non-function value. If the dispatcher itself throws, the error propagates to the caller and the library recovers on the next scheduling attempt.
108
112
 
109
113
  ## How it works
110
114
 
111
- The library tracks when the last yield occurred using `performance.now()`. When `shouldYield()` detects that more than `timeout` milliseconds have elapsed, it signals that a yield is due. `doYield` and `maybeYield` batch pending callbacks into a queue that is drained in a single microtask turn, yielding again if the timeout is exceeded during draining.
115
+ The library tracks when the last yield occurred using `performance.now()`. When `shouldYield()` detects that more than `timeout` milliseconds have elapsed, it signals that a yield is due. `doYield` and `maybeYield` batch pending callbacks into a queue that is drained on the next event-loop turn (via `setImmediate` by default), yielding again if the timeout is exceeded during draining.
112
116
 
113
117
  ## License
114
118
 
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type Dispatcher = (callback: () => void) => void;
2
- export declare function setYieldDispatcher(schedule: Dispatcher | null): void;
2
+ export declare function setYieldDispatcher(schedule?: Dispatcher | null): void;
3
3
  export declare function setYieldTimeout(timeout: number): void;
4
4
  export declare function shouldYield(timeout?: number): boolean;
5
5
  export declare function maybeYield<T>(callback: (opaque: T | undefined) => void, opaque?: T, timeout?: number): void;
@@ -7,3 +7,4 @@ export declare function maybeYield(timeout?: number): Promise<void> | null;
7
7
  export declare function doYield<T>(callback: (opaque: T | undefined) => void, opaque?: T): void;
8
8
  export declare function doYield(): Promise<void>;
9
9
  export {};
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;AAahD,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,IAAI,QAK9D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAK9C;AAaD,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,WAmB3C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,EACzC,MAAM,CAAC,EAAE,CAAC,EACV,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAAA;AACP,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAmClE,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;AACvF,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA"}
package/lib/index.js CHANGED
@@ -1,146 +1,162 @@
1
-
2
-
3
- const kDefaultSchedule =
4
- globalThis.setImmediate ?? ((fn ) => setTimeout(fn, 0))
5
- let yieldSchedule = kDefaultSchedule
6
- const yieldQueue = []
7
-
8
- let yieldIndex = 0
9
- let yieldTimeout = 40
10
- let yieldActive = false
11
- let yieldScheduled = false
12
- let yieldTime = performance.now()
13
-
14
- export function setYieldDispatcher(schedule ) {
15
- yieldSchedule = schedule ?? kDefaultSchedule
1
+ const kDefaultSchedule = globalThis.setImmediate ?? ((fn) => setTimeout(fn, 0));
2
+ let yieldSchedule = kDefaultSchedule;
3
+ const yieldQueue = [];
4
+ let yieldIndex = 0;
5
+ let yieldTimeout = 40;
6
+ let yieldActive = false;
7
+ let yieldScheduled = false;
8
+ let yieldTime = performance.now();
9
+ export function setYieldDispatcher(schedule) {
10
+ if (schedule != null && typeof schedule !== 'function') {
11
+ throw new TypeError('dispatcher must be a function, null, or undefined');
12
+ }
13
+ yieldSchedule = schedule ?? kDefaultSchedule;
14
+ }
15
+ export function setYieldTimeout(timeout) {
16
+ if (typeof timeout !== 'number' || Number.isNaN(timeout) || timeout < 0) {
17
+ throw new TypeError('timeout must be a non-negative number');
18
+ }
19
+ yieldTimeout = timeout;
16
20
  }
17
-
18
- export function setYieldTimeout(timeout ) {
19
- if (typeof timeout !== 'number' || timeout < 0) {
20
- throw new TypeError('timeout must be a positive number')
21
- }
22
- yieldTimeout = timeout
21
+ function scheduleDispatch() {
22
+ yieldScheduled = true;
23
+ try {
24
+ yieldSchedule(dispatchYield);
25
+ }
26
+ catch (err) {
27
+ // Leave the queue recoverable: the next schedule attempt retries.
28
+ yieldScheduled = false;
29
+ throw err;
30
+ }
23
31
  }
24
-
25
- export function shouldYield(timeout ) {
26
- if (timeout === undefined) {
27
- timeout = yieldTimeout
28
- }
29
-
30
- if (!yieldActive && performance.now() - yieldTime >= timeout) {
31
- yieldActive = true
32
- }
33
-
34
- return yieldActive
32
+ export function shouldYield(timeout) {
33
+ if (timeout === undefined) {
34
+ timeout = yieldTimeout;
35
+ }
36
+ if (!yieldActive && performance.now() - yieldTime >= timeout) {
37
+ yieldActive = true;
38
+ // Self-heal standalone usage: ensure a dispatch is pending so the latch
39
+ // and clock reset on the next event-loop turn even if the caller never
40
+ // enqueues a yield.
41
+ if (!yieldScheduled) {
42
+ scheduleDispatch();
43
+ }
44
+ // A synchronous dispatcher may already have run the reset dispatch,
45
+ // clearing yieldActive — still report that a yield was due at call time.
46
+ return true;
47
+ }
48
+ return yieldActive;
35
49
  }
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
- export function maybeYield (
44
- callbackOrTimeout ,
45
- opaque ,
46
- timeout ,
47
- ) {
48
- if (
49
- callbackOrTimeout != null &&
50
- typeof callbackOrTimeout !== 'function' &&
51
- typeof callbackOrTimeout !== 'number'
52
- ) {
53
- throw new TypeError('callback must be a function')
54
- }
55
-
56
- const callback = typeof callbackOrTimeout === 'function' ? callbackOrTimeout : undefined
57
- if (timeout === undefined && typeof callbackOrTimeout === 'number') {
58
- timeout = callbackOrTimeout
59
- }
60
-
61
- if (shouldYield(timeout)) {
50
+ export function maybeYield(callbackOrTimeout, opaque, timeout) {
51
+ if (callbackOrTimeout != null &&
52
+ typeof callbackOrTimeout !== 'function' &&
53
+ typeof callbackOrTimeout !== 'number') {
54
+ throw new TypeError('callback must be a function');
55
+ }
56
+ const callback = typeof callbackOrTimeout === 'function' ? callbackOrTimeout : undefined;
57
+ if (timeout === undefined && typeof callbackOrTimeout === 'number') {
58
+ timeout = callbackOrTimeout;
59
+ }
60
+ if (shouldYield(timeout)) {
61
+ if (callback != null) {
62
+ doYield(callback, opaque);
63
+ return;
64
+ }
65
+ return doYield();
66
+ }
62
67
  if (callback != null) {
63
- doYield(callback, opaque)
64
- return
65
- }
66
- return doYield()
67
- }
68
-
69
- if (callback != null) {
70
- callback(opaque)
71
- return
72
- }
73
-
74
- return null
68
+ callback(opaque);
69
+ return;
70
+ }
71
+ return null;
75
72
  }
76
-
77
-
78
-
79
- export function doYield (
80
- callback ,
81
- opaque ,
82
- ) {
83
- if (callback != null && typeof callback !== 'function') {
84
- throw new TypeError('callback must be a function')
85
- }
86
-
87
- if (!yieldScheduled) {
88
- yieldScheduled = true
89
- yieldSchedule(dispatchYield)
90
- }
91
-
92
- if (callback == null) {
93
- return new Promise((resolve) => {
94
- yieldQueue.push(resolve, null)
95
- })
96
- }
97
-
98
- yieldQueue.push(callback, opaque)
73
+ export function doYield(callback, opaque) {
74
+ if (callback != null && typeof callback !== 'function') {
75
+ throw new TypeError('callback must be a function');
76
+ }
77
+ // Enqueue before scheduling so a misbehaving synchronous dispatcher cannot
78
+ // drain past this item and strand it.
79
+ let promise;
80
+ if (callback == null) {
81
+ promise = new Promise((resolve) => {
82
+ yieldQueue.push(resolve, undefined);
83
+ });
84
+ }
85
+ else {
86
+ yieldQueue.push(callback, opaque);
87
+ }
88
+ if (!yieldScheduled) {
89
+ scheduleDispatch();
90
+ }
91
+ return promise;
99
92
  }
100
-
93
+ let yieldDispatching = false;
94
+ let yieldRedispatch = false;
101
95
  function dispatchYield() {
102
- yieldTime = performance.now()
103
- yieldActive = false
104
-
105
- const maxIndex = yieldQueue.length
106
-
107
- while (yieldIndex < maxIndex) {
108
- const resolve = yieldQueue[yieldIndex]
109
- yieldQueue[yieldIndex] = null
110
- yieldIndex += 1
111
-
112
- const opaque = yieldQueue[yieldIndex]
113
- yieldQueue[yieldIndex] = null
114
- yieldIndex += 1
115
-
96
+ // A synchronous dispatcher re-enters here from the tail reschedule in
97
+ // drainYieldQueue; flatten the recursion into the outer frame's loop so a
98
+ // deep backlog cannot overflow the stack.
99
+ if (yieldDispatching) {
100
+ yieldRedispatch = true;
101
+ return;
102
+ }
103
+ yieldDispatching = true;
116
104
  try {
117
- resolve(opaque)
118
- } catch (err) {
119
- // Isolate the throw: rethrow asynchronously so dispatch continues.
120
- // Otherwise yieldIndex stays mid-loop and the queue gets stuck.
121
- // Materialize the stack now — queueMicrotask severs the sync frame.
122
- if (err instanceof Error) {
123
- void err.stack
124
- }
125
- queueMicrotask(() => {
126
- throw err
127
- })
128
- }
129
-
130
- if (shouldYield()) {
131
- break
132
- }
133
- }
134
-
135
- if (yieldIndex === yieldQueue.length) {
136
- yieldScheduled = false
137
- yieldQueue.length = 0
138
- yieldIndex = 0
139
- } else {
140
- if (yieldIndex > 4 * 1024) {
141
- yieldQueue.splice(0, yieldIndex)
142
- yieldIndex = 0
143
- }
144
- yieldSchedule(dispatchYield)
145
- }
105
+ do {
106
+ yieldRedispatch = false;
107
+ drainYieldQueue();
108
+ } while (yieldRedispatch);
109
+ }
110
+ finally {
111
+ yieldDispatching = false;
112
+ }
113
+ }
114
+ function drainYieldQueue() {
115
+ yieldTime = performance.now();
116
+ yieldActive = false;
117
+ const startIndex = yieldIndex;
118
+ const maxIndex = yieldQueue.length;
119
+ while (yieldIndex < maxIndex) {
120
+ const resolve = yieldQueue[yieldIndex];
121
+ const opaque = yieldQueue[yieldIndex + 1];
122
+ yieldIndex += 2;
123
+ try {
124
+ resolve(opaque);
125
+ }
126
+ catch (err) {
127
+ // Isolate the throw: rethrow asynchronously so dispatch continues.
128
+ // Otherwise yieldIndex stays mid-loop and the queue gets stuck.
129
+ // Materialize the stack now — queueMicrotask severs the sync frame.
130
+ if (err instanceof Error) {
131
+ void err.stack;
132
+ }
133
+ queueMicrotask(() => {
134
+ throw err;
135
+ });
136
+ }
137
+ if (shouldYield()) {
138
+ break;
139
+ }
140
+ }
141
+ if (yieldIndex === yieldQueue.length) {
142
+ yieldScheduled = false;
143
+ yieldQueue.length = 0;
144
+ yieldIndex = 0;
145
+ }
146
+ else {
147
+ if (yieldIndex > 4 * 1024 && 2 * yieldIndex >= yieldQueue.length) {
148
+ // Amortized O(1): only compact once the consumed prefix is at least
149
+ // half the array, so each splice shifts at most as many elements as
150
+ // were consumed since the previous compaction.
151
+ yieldQueue.splice(0, yieldIndex);
152
+ yieldIndex = 0;
153
+ }
154
+ else {
155
+ // Release references to consumed callbacks/opaques. Full drains skip
156
+ // this — truncating the queue above releases everything at once.
157
+ yieldQueue.fill(null, startIndex, yieldIndex);
158
+ }
159
+ scheduleDispatch();
160
+ }
146
161
  }
162
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GACpB,UAAU,CAAC,YAAY,IAAI,CAAC,CAAC,EAAc,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;AACpE,IAAI,aAAa,GAAG,gBAAgB,CAAA;AACpC,MAAM,UAAU,GAAmB,EAAE,CAAA;AAErC,IAAI,UAAU,GAAG,CAAC,CAAA;AAClB,IAAI,YAAY,GAAG,EAAE,CAAA;AACrB,IAAI,WAAW,GAAG,KAAK,CAAA;AACvB,IAAI,cAAc,GAAG,KAAK,CAAA;AAC1B,IAAI,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAA;AAEjC,MAAM,UAAU,kBAAkB,CAAC,QAA4B;IAC7D,IAAI,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvD,MAAM,IAAI,SAAS,CAAC,mDAAmD,CAAC,CAAA;IAC1E,CAAC;IACD,aAAa,GAAG,QAAQ,IAAI,gBAAgB,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAA;IAC9D,CAAC;IACD,YAAY,GAAG,OAAO,CAAA;AACxB,CAAC;AAED,SAAS,gBAA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,EAAE,UAAU,CAAC,CAAA;YAChC,UAAU,GAAG,CAAC,CAAA;QAChB,CAAC;aAAM,CAAC;YACN,qEAAqE;YACrE,iEAAiE;YACjE,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;QAC/C,CAAC;QACD,gBAAgB,EAAE,CAAA;IACpB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/yield",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "access": "public"
15
15
  },
16
16
  "scripts": {
17
- "build": "rimraf lib && tsc -p tsconfig.build.json && amaroc ./src/index.ts && mv src/index.js lib/",
17
+ "build": "rimraf lib && tsc -p tsconfig.build.json",
18
18
  "prepublishOnly": "yarn build",
19
19
  "typecheck": "tsc --noEmit",
20
20
  "test": "node --test",
@@ -23,11 +23,10 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^25.5.0",
26
- "amaroc": "^1.0.1",
27
26
  "oxlint-tsgolint": "^0.17.0",
28
27
  "rimraf": "^6.1.3",
29
28
  "tsd": "^0.33.0",
30
29
  "typescript": "^5.9.3"
31
30
  },
32
- "gitHead": "7c9c7457c885c644c7a1e70ef894d4727ce240d6"
31
+ "gitHead": "c9f2526dc870597de119b8ec5083f97901d4a2e2"
33
32
  }