],
rules: {
'sort-imports': [
- 'warn',
+ 'error',
{
- ignoreMemberSort: true,
ignoreDeclarationSort: true
}
],
+ 'import/order': 'error',
'spellcheck/spell-checker': [
'warn',
const crypto = require('crypto')
const fs = require('fs')
-const {
- PoolTypes,
- WorkerFunctions,
- WorkerTypes
-} = require('./benchmarks-types')
const {
DynamicClusterPool,
DynamicThreadPool,
FixedClusterPool,
FixedThreadPool
} = require('../lib')
+const {
+ PoolTypes,
+ WorkerFunctions,
+ WorkerTypes
+} = require('./benchmarks-types')
async function runTest (pool, { taskExecutions, workerData }) {
return new Promise((resolve, reject) => {
'use strict'
-const { ThreadWorker } = require('poolifier')
const { isMainThread } = require('worker_threads')
+const { ThreadWorker } = require('poolifier')
const debug = false
"mocha": "^10.2.0",
"mochawesome": "^7.1.3",
"prettier": "^2.8.8",
- "prettier-plugin-organize-imports": "^3.2.2",
"release-it": "^15.10.2",
"rollup": "^3.21.2",
"rollup-plugin-analyzer": "^4.0.0",
prettier:
specifier: ^2.8.8
version: 2.8.8
- prettier-plugin-organize-imports:
- specifier: ^3.2.2
- version: 3.2.2(prettier@2.8.8)(typescript@5.0.4)
release-it:
specifier: ^15.10.2
version: 15.10.2
engines: {node: '>= 0.8.0'}
dev: true
- /prettier-plugin-organize-imports@3.2.2(prettier@2.8.8)(typescript@5.0.4):
- resolution: {integrity: sha512-e97lE6odGSiHonHJMTYC0q0iLXQyw0u5z/PJpvP/3vRy6/Zi9kLBwFAbEGjDzIowpjQv8b+J04PDamoUSQbzGA==}
- peerDependencies:
- '@volar/vue-language-plugin-pug': ^1.0.4
- '@volar/vue-typescript': ^1.0.4
- prettier: '>=2.0'
- typescript: '>=2.9'
- peerDependenciesMeta:
- '@volar/vue-language-plugin-pug':
- optional: true
- '@volar/vue-typescript':
- optional: true
- dependencies:
- prettier: 2.8.8
- typescript: 5.0.4
- dev: true
-
/prettier@2.8.8:
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
engines: {node: '>=10.13.0'}
median
} from '../utils'
import { KillBehaviors, isKillBehavior } from '../worker/worker-options'
+import { CircularArray } from '../circular-array'
import {
+ type IPool,
PoolEmitter,
PoolEvents,
- type IPool,
type PoolOptions,
- type TasksQueueOptions,
- PoolType
+ PoolType,
+ type TasksQueueOptions
} from './pool'
import type { IWorker, Task, TasksUsage, WorkerNode } from './worker'
import {
type WorkerChoiceStrategyOptions
} from './selection-strategies/selection-strategies-types'
import { WorkerChoiceStrategyContext } from './selection-strategies/worker-choice-strategy-context'
-import { CircularArray } from '../circular-array'
/**
* Base class that implements some shared logic for all poolifier pools.
import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
-import { PoolType, type IPool } from '../pool'
+import { type IPool, PoolType } from '../pool'
import type { IWorker } from '../worker'
import type {
IWorkerChoiceStrategy,
import { cpus } from 'node:os'
import type { IWorker } from '../worker'
+import type { IPool } from '../pool'
+import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
import type {
IWorkerChoiceStrategy,
RequiredStatistics,
WorkerChoiceStrategyOptions
} from './selection-strategies-types'
-import type { IPool } from '../pool'
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
/**
* Virtual task runtime.
import {
- isMainThread,
MessageChannel,
SHARE_ENV,
- Worker
+ Worker,
+ isMainThread
} from 'node:worker_threads'
import type { Draft, MessageValue } from '../../utility-types'
import { AbstractPool } from '../abstract-pool'
'use strict'
-const { ClusterWorker, KillBehaviors } = require('../../../lib')
const { isMaster } = require('cluster')
+const { ClusterWorker, KillBehaviors } = require('../../../lib')
const TestUtils = require('../../test-utils')
const { WorkerFunctions } = require('../../test-types')
'use strict'
-const { ThreadWorker, KillBehaviors } = require('../../../lib')
const { isMainThread } = require('worker_threads')
+const { ThreadWorker, KillBehaviors } = require('../../../lib')
const TestUtils = require('../../test-utils')
const { WorkerFunctions } = require('../../test-types')