refactor: code cleanups
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 8 May 2024 21:26:43 +0000 (23:26 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 8 May 2024 21:26:43 +0000 (23:26 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/worker-node.ts
tests/pools/abstract-pool.test.mjs
tests/pools/worker-node.test.mjs

index 772a839b1c077d23ae53f73b7a1475daa4c8bddc..88c6e8d18bceea402f24d5b88bf5aa9ce4db0b78 100644 (file)
@@ -212,8 +212,8 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
       type: getWorkerType(worker)!,
       dynamic: false,
       ready: false,
-      backPressure: false,
-      stealing: false
+      stealing: false,
+      backPressure: false
     }
   }
 
index 8cbbc0a5dc59e522f3328271dbfd8cd812586388..8cae47d6bdca9f2289a9844c655d602a670e4dd6 100644 (file)
@@ -819,8 +819,8 @@ describe('Abstract pool test suite', () => {
         type: WorkerTypes.cluster,
         dynamic: false,
         ready: true,
-        backPressure: false,
-        stealing: false
+        stealing: false,
+        backPressure: false
       })
     }
     await pool.destroy()
@@ -836,8 +836,8 @@ describe('Abstract pool test suite', () => {
         type: WorkerTypes.thread,
         dynamic: false,
         ready: true,
-        backPressure: false,
-        stealing: false
+        stealing: false,
+        backPressure: false
       })
     }
     await pool.destroy()
index 27ce3d2d4c66e27a6385a360c6efb12544099ac9..a29322825912d17dc2027d0c57eaa0e76b1a2212 100644 (file)
@@ -192,8 +192,8 @@ describe('Worker node test suite', () => {
       type: WorkerTypes.thread,
       dynamic: false,
       ready: false,
-      backPressure: false,
-      stealing: false
+      stealing: false,
+      backPressure: false
     })
     expect(threadWorkerNode.usage).toStrictEqual({
       tasks: {
@@ -238,8 +238,8 @@ describe('Worker node test suite', () => {
       type: WorkerTypes.cluster,
       dynamic: false,
       ready: false,
-      backPressure: false,
-      stealing: false
+      stealing: false,
+      backPressure: false
     })
     expect(clusterWorkerNode.usage).toStrictEqual({
       tasks: {