@nxtedition/yield 1.0.19 → 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;
@@ -1 +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,EAAE,UAAU,GAAG,IAAI,QAE7D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAK9C;AAED,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,WAU3C;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"}
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
@@ -7,20 +7,43 @@ let yieldActive = false;
7
7
  let yieldScheduled = false;
8
8
  let yieldTime = performance.now();
9
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
+ }
10
13
  yieldSchedule = schedule ?? kDefaultSchedule;
11
14
  }
12
15
  export function setYieldTimeout(timeout) {
13
- if (typeof timeout !== 'number' || timeout < 0) {
14
- throw new TypeError('timeout must be a positive number');
16
+ if (typeof timeout !== 'number' || Number.isNaN(timeout) || timeout < 0) {
17
+ throw new TypeError('timeout must be a non-negative number');
15
18
  }
16
19
  yieldTimeout = timeout;
17
20
  }
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
+ }
31
+ }
18
32
  export function shouldYield(timeout) {
19
33
  if (timeout === undefined) {
20
34
  timeout = yieldTimeout;
21
35
  }
22
36
  if (!yieldActive && performance.now() - yieldTime >= timeout) {
23
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;
24
47
  }
25
48
  return yieldActive;
26
49
  }
@@ -51,28 +74,52 @@ export function doYield(callback, opaque) {
51
74
  if (callback != null && typeof callback !== 'function') {
52
75
  throw new TypeError('callback must be a function');
53
76
  }
54
- if (!yieldScheduled) {
55
- yieldScheduled = true;
56
- yieldSchedule(dispatchYield);
57
- }
77
+ // Enqueue before scheduling so a misbehaving synchronous dispatcher cannot
78
+ // drain past this item and strand it.
79
+ let promise;
58
80
  if (callback == null) {
59
- return new Promise((resolve) => {
60
- yieldQueue.push(resolve, null);
81
+ promise = new Promise((resolve) => {
82
+ yieldQueue.push(resolve, undefined);
61
83
  });
62
84
  }
63
- yieldQueue.push(callback, opaque);
85
+ else {
86
+ yieldQueue.push(callback, opaque);
87
+ }
88
+ if (!yieldScheduled) {
89
+ scheduleDispatch();
90
+ }
91
+ return promise;
64
92
  }
93
+ let yieldDispatching = false;
94
+ let yieldRedispatch = false;
65
95
  function dispatchYield() {
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;
104
+ try {
105
+ do {
106
+ yieldRedispatch = false;
107
+ drainYieldQueue();
108
+ } while (yieldRedispatch);
109
+ }
110
+ finally {
111
+ yieldDispatching = false;
112
+ }
113
+ }
114
+ function drainYieldQueue() {
66
115
  yieldTime = performance.now();
67
116
  yieldActive = false;
117
+ const startIndex = yieldIndex;
68
118
  const maxIndex = yieldQueue.length;
69
119
  while (yieldIndex < maxIndex) {
70
120
  const resolve = yieldQueue[yieldIndex];
71
- yieldQueue[yieldIndex] = null;
72
- yieldIndex += 1;
73
- const opaque = yieldQueue[yieldIndex];
74
- yieldQueue[yieldIndex] = null;
75
- yieldIndex += 1;
121
+ const opaque = yieldQueue[yieldIndex + 1];
122
+ yieldIndex += 2;
76
123
  try {
77
124
  resolve(opaque);
78
125
  }
@@ -97,11 +144,19 @@ function dispatchYield() {
97
144
  yieldIndex = 0;
98
145
  }
99
146
  else {
100
- if (yieldIndex > 4 * 1024) {
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.
101
151
  yieldQueue.splice(0, yieldIndex);
102
152
  yieldIndex = 0;
103
153
  }
104
- yieldSchedule(dispatchYield);
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();
105
160
  }
106
161
  }
107
162
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +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,C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AAC,OAAO,GAAG,EAAE,CAAC;YACb,mEAAmE;YACnE,gEAAgE;YAChE,oEAAoE;YACpE,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;gBACzB,KAAK,GAAG,CAAC,KAAK,CAAA;YAChB,CAAC;YACD,cAAc,CAAC,GAAG,EAAE;gBAClB,MAAM,GAAG,CAAA;YACX,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,IAAI,WAAW,EAAE,EAAE,CAAC;YAClB,MAAK;QACP,CAAC;IACH,CAAC;IAED,IAAI,UAAU,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;QACrC,cAAc,GAAG,KAAK,CAAA;QACtB,UAAU,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,UAAU,GAAG,CAAC,CAAA;IAChB,CAAC;SAAM,CAAC;QACN,IAAI,UAAU,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,UAAU,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;YACjE,oEAAoE;YACpE,oEAAoE;YACpE,+CAA+C;YAC/C,UAAU,CAAC,MAAM,CAAC,CAAC,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.19",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -28,5 +28,5 @@
28
28
  "tsd": "^0.33.0",
29
29
  "typescript": "^5.9.3"
30
30
  },
31
- "gitHead": "7c9c7457c885c644c7a1e70ef894d4727ce240d6"
31
+ "gitHead": "c9f2526dc870597de119b8ec5083f97901d4a2e2"
32
32
  }