@nxtedition/scheduler 2.0.1 → 2.0.3

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -4
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -103,11 +103,11 @@ export class Scheduler {
103
103
  if (this.#running < 1 || this.#stateView[RUNNING_INDEX] < queue.lim) {
104
104
  Atomics.add(this.#stateView, RUNNING_INDEX, 1)
105
105
  this.#running += 1
106
- return fn()
106
+ return fn(opaque)
107
107
  }
108
108
  } else if (this.#running < 1 || this.#running < queue.lim) {
109
109
  this.#running += 1
110
- return fn()
110
+ return fn(opaque)
111
111
  }
112
112
 
113
113
  queue.arr.push(fn, opaque)
@@ -145,9 +145,9 @@ export class Scheduler {
145
145
  break
146
146
  }
147
147
 
148
- if ((this.#counter & 63) === 0) {
148
+ if ((this.#counter & 63) === 0 && this.#lowQueue.cnt > 0) {
149
149
  queue = this.#lowQueue
150
- } else if ((this.#counter & 15) === 0) {
150
+ } else if ((this.#counter & 15) === 0 && this.#normalQueue.cnt > 0) {
151
151
  queue = this.#normalQueue
152
152
  }
153
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/scheduler",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -20,5 +20,5 @@
20
20
  "rimraf": "^6.1.2",
21
21
  "typescript": "^5.9.3"
22
22
  },
23
- "gitHead": "5331546a23803c5b8198f16f78d71fa0dc01e568"
23
+ "gitHead": "c9cfc87959862c94ed18d15b6090eff035ed271a"
24
24
  }