-const { MessageChannel, Worker } = require('worker_threads')
-const cluster = require('cluster')
+const { MessageChannel, Worker } = require('node:worker_threads')
+const cluster = require('node:cluster')
const { expect } = require('expect')
const { WorkerNode } = require('../../../lib/pools/worker-node')
const { WorkerTypes } = require('../../../lib')
expect(threadWorkerNode.tasksQueueBackPressureSize).toBe(12)
expect(threadWorkerNode.tasksQueue).toBeInstanceOf(Deque)
expect(threadWorkerNode.tasksQueue.size).toBe(0)
+ expect(threadWorkerNode.tasksQueueSize()).toBe(
+ threadWorkerNode.tasksQueue.size
+ )
+ expect(threadWorkerNode.onBackPressureStarted).toBe(false)
+ expect(threadWorkerNode.onEmptyQueueCount).toBe(0)
expect(threadWorkerNode.taskFunctionsUsage).toBeInstanceOf(Map)
expect(clusterWorkerNode).toBeInstanceOf(WorkerNode)
expect(clusterWorkerNode.tasksQueueBackPressureSize).toBe(12)
expect(clusterWorkerNode.tasksQueue).toBeInstanceOf(Deque)
expect(clusterWorkerNode.tasksQueue.size).toBe(0)
+ expect(clusterWorkerNode.tasksQueueSize()).toBe(
+ clusterWorkerNode.tasksQueue.size
+ )
+ expect(clusterWorkerNode.onBackPressureStarted).toBe(false)
+ expect(clusterWorkerNode.onEmptyQueueCount).toBe(0)
expect(clusterWorkerNode.taskFunctionsUsage).toBeInstanceOf(Map)
})