},
"devDependencies": {
"@biomejs/biome": "^2.3.8",
- "@commitlint/cli": "^20.1.0",
- "@commitlint/config-conventional": "^20.0.0",
+ "@commitlint/cli": "^20.2.0",
+ "@commitlint/config-conventional": "^20.2.0",
"@cspell/eslint-plugin": "^9.4.0",
"@eslint/js": "^9.39.1",
"@rollup/plugin-terser": "^0.4.4",
"clean-publish": "^6.0.1",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
- "eslint-plugin-jsdoc": "^61.4.1",
+ "eslint-plugin-jsdoc": "^61.5.0",
"eslint-plugin-perfectionist": "^4.15.1",
"globals": "^16.5.0",
"husky": "^9.1.7",
"mocha": "^11.7.5",
"mochawesome": "^7.1.4",
"neostandard": "^0.12.2",
- "prettier": "^3.7.3",
+ "prettier": "^3.7.4",
"rollup": "^4.53.3",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-command": "^1.1.3",
specifier: ^2.3.8
version: 2.3.8
'@commitlint/cli':
- specifier: ^20.1.0
- version: 20.1.0(@types/node@24.10.1)(typescript@5.9.3)
+ specifier: ^20.2.0
+ version: 20.2.0(@types/node@24.10.1)(typescript@5.9.3)
'@commitlint/config-conventional':
- specifier: ^20.0.0
- version: 20.0.0
+ specifier: ^20.2.0
+ version: 20.2.0
'@cspell/eslint-plugin':
specifier: ^9.4.0
version: 9.4.0(eslint@9.39.1(jiti@2.6.1))
specifier: ^9.39.1
version: 9.39.1(jiti@2.6.1)
eslint-plugin-jsdoc:
- specifier: ^61.4.1
- version: 61.4.1(eslint@9.39.1(jiti@2.6.1))
+ specifier: ^61.5.0
+ version: 61.5.0(eslint@9.39.1(jiti@2.6.1))
eslint-plugin-perfectionist:
specifier: ^4.15.1
version: 4.15.1(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
specifier: ^0.12.2
version: 0.12.2(@typescript-eslint/utils@8.48.1(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)
prettier:
- specifier: ^3.7.3
- version: 3.7.3
+ specifier: ^3.7.4
+ version: 3.7.4
rollup:
specifier: ^4.53.3
version: 4.53.3
cpu: [x64]
os: [win32]
- '@commitlint/cli@20.1.0':
- resolution: {integrity: sha512-pW5ujjrOovhq5RcYv5xCpb4GkZxkO2+GtOdBW2/qrr0Ll9tl3PX0aBBobGQl3mdZUbOBgwAexEQLeH6uxL0VYg==}
+ '@commitlint/cli@20.2.0':
+ resolution: {integrity: sha512-l37HkrPZ2DZy26rKiTUvdq/LZtlMcxz+PeLv9dzK9NzoFGuJdOQyYU7IEkEQj0pO++uYue89wzOpZ0hcTtoqUA==}
engines: {node: '>=v18'}
hasBin: true
- '@commitlint/config-conventional@20.0.0':
- resolution: {integrity: sha512-q7JroPIkDBtyOkVe9Bca0p7kAUYxZMxkrBArCfuD3yN4KjRAenP9PmYwnn7rsw8Q+hHq1QB2BRmBh0/Z19ZoJw==}
+ '@commitlint/config-conventional@20.2.0':
+ resolution: {integrity: sha512-MsRac+yNIbTB4Q/psstKK4/ciVzACHicSwz+04Sxve+4DW+PiJeTjU0JnS4m/oOnulrXYN+yBPlKaBSGemRfgQ==}
engines: {node: '>=v18'}
- '@commitlint/config-validator@20.0.0':
- resolution: {integrity: sha512-BeyLMaRIJDdroJuYM2EGhDMGwVBMZna9UiIqV9hxj+J551Ctc6yoGuGSmghOy/qPhBSuhA6oMtbEiTmxECafsg==}
+ '@commitlint/config-validator@20.2.0':
+ resolution: {integrity: sha512-SQCBGsL9MFk8utWNSthdxd9iOD1pIVZSHxGBwYIGfd67RTjxqzFOSAYeQVXOu3IxRC3YrTOH37ThnTLjUlyF2w==}
engines: {node: '>=v18'}
- '@commitlint/ensure@20.0.0':
- resolution: {integrity: sha512-WBV47Fffvabe68n+13HJNFBqiMH5U1Ryls4W3ieGwPC0C7kJqp3OVQQzG2GXqOALmzrgAB+7GXmyy8N9ct8/Fg==}
+ '@commitlint/ensure@20.2.0':
+ resolution: {integrity: sha512-+8TgIGv89rOWyt3eC6lcR1H7hqChAKkpawytlq9P1i/HYugFRVqgoKJ8dhd89fMnlrQTLjA5E97/4sF09QwdoA==}
engines: {node: '>=v18'}
'@commitlint/execute-rule@20.0.0':
resolution: {integrity: sha512-xyCoOShoPuPL44gVa+5EdZsBVao/pNzpQhkzq3RdtlFdKZtjWcLlUFQHSWBuhk5utKYykeJPSz2i8ABHQA+ZZw==}
engines: {node: '>=v18'}
- '@commitlint/format@20.0.0':
- resolution: {integrity: sha512-zrZQXUcSDmQ4eGGrd+gFESiX0Rw+WFJk7nW4VFOmxub4mAATNKBQ4vNw5FgMCVehLUKG2OT2LjOqD0Hk8HvcRg==}
+ '@commitlint/format@20.2.0':
+ resolution: {integrity: sha512-PhNoLNhxpfIBlW/i90uZ3yG3hwSSYx7n4d9Yc+2FAorAHS0D9btYRK4ZZXX+Gm3W5tDtu911ow/eWRfcRVgNWg==}
engines: {node: '>=v18'}
- '@commitlint/is-ignored@20.0.0':
- resolution: {integrity: sha512-ayPLicsqqGAphYIQwh9LdAYOVAQ9Oe5QCgTNTj+BfxZb9b/JW222V5taPoIBzYnAP0z9EfUtljgBk+0BN4T4Cw==}
+ '@commitlint/is-ignored@20.2.0':
+ resolution: {integrity: sha512-Lz0OGeZCo/QHUDLx5LmZc0EocwanneYJUM8z0bfWexArk62HKMLfLIodwXuKTO5y0s6ddXaTexrYHs7v96EOmw==}
engines: {node: '>=v18'}
- '@commitlint/lint@20.0.0':
- resolution: {integrity: sha512-kWrX8SfWk4+4nCexfLaQT3f3EcNjJwJBsSZ5rMBw6JCd6OzXufFHgel2Curos4LKIxwec9WSvs2YUD87rXlxNQ==}
+ '@commitlint/lint@20.2.0':
+ resolution: {integrity: sha512-cQEEB+jlmyQbyiji/kmh8pUJSDeUmPiWq23kFV0EtW3eM+uAaMLMuoTMajbrtWYWQpPzOMDjYltQ8jxHeHgITg==}
engines: {node: '>=v18'}
- '@commitlint/load@20.1.0':
- resolution: {integrity: sha512-qo9ER0XiAimATQR5QhvvzePfeDfApi/AFlC1G+YN+ZAY8/Ua6IRrDrxRvQAr+YXUKAxUsTDSp9KXeXLBPsNRWg==}
+ '@commitlint/load@20.2.0':
+ resolution: {integrity: sha512-iAK2GaBM8sPFTSwtagI67HrLKHIUxQc2BgpgNc/UMNme6LfmtHpIxQoN1TbP+X1iz58jq32HL1GbrFTCzcMi6g==}
engines: {node: '>=v18'}
'@commitlint/message@20.0.0':
resolution: {integrity: sha512-gLX4YmKnZqSwkmSB9OckQUrI5VyXEYiv3J5JKZRxIp8jOQsWjZgHSG/OgEfMQBK9ibdclEdAyIPYggwXoFGXjQ==}
engines: {node: '>=v18'}
- '@commitlint/parse@20.0.0':
- resolution: {integrity: sha512-j/PHCDX2bGM5xGcWObOvpOc54cXjn9g6xScXzAeOLwTsScaL4Y+qd0pFC6HBwTtrH92NvJQc+2Lx9HFkVi48cg==}
+ '@commitlint/parse@20.2.0':
+ resolution: {integrity: sha512-LXStagGU1ivh07X7sM+hnEr4BvzFYn1iBJ6DRg2QsIN8lBfSzyvkUcVCDwok9Ia4PWiEgei5HQjju6xfJ1YaSQ==}
engines: {node: '>=v18'}
- '@commitlint/read@20.0.0':
- resolution: {integrity: sha512-Ti7Y7aEgxsM1nkwA4ZIJczkTFRX/+USMjNrL9NXwWQHqNqrBX2iMi+zfuzZXqfZ327WXBjdkRaytJ+z5vNqTOA==}
+ '@commitlint/read@20.2.0':
+ resolution: {integrity: sha512-+SjF9mxm5JCbe+8grOpXCXMMRzAnE0WWijhhtasdrpJoAFJYd5UgRTj/oCq5W3HJTwbvTOsijEJ0SUGImECD7Q==}
engines: {node: '>=v18'}
- '@commitlint/resolve-extends@20.1.0':
- resolution: {integrity: sha512-cxKXQrqHjZT3o+XPdqDCwOWVFQiae++uwd9dUBC7f2MdV58ons3uUvASdW7m55eat5sRiQ6xUHyMWMRm6atZWw==}
+ '@commitlint/resolve-extends@20.2.0':
+ resolution: {integrity: sha512-KVoLDi9BEuqeq+G0wRABn4azLRiCC22/YHR2aCquwx6bzCHAIN8hMt3Nuf1VFxq/c8ai6s8qBxE8+ZD4HeFTlQ==}
engines: {node: '>=v18'}
- '@commitlint/rules@20.0.0':
- resolution: {integrity: sha512-gvg2k10I/RfvHn5I5sxvVZKM1fl72Sqrv2YY/BnM7lMHcYqO0E2jnRWoYguvBfEcZ39t+rbATlciggVe77E4zA==}
+ '@commitlint/rules@20.2.0':
+ resolution: {integrity: sha512-27rHGpeAjnYl/A+qUUiYDa7Yn1WIjof/dFJjYW4gA1Ug+LUGa1P0AexzGZ5NBxTbAlmDgaxSZkLLxtLVqtg8PQ==}
engines: {node: '>=v18'}
'@commitlint/to-lines@20.0.0':
resolution: {integrity: sha512-drXaPSP2EcopukrUXvUXmsQMu3Ey/FuJDc/5oiW4heoCfoE5BdLQyuc7veGeE3aoQaTVqZnh4D5WTWe2vefYKg==}
engines: {node: '>=v18'}
- '@commitlint/types@20.0.0':
- resolution: {integrity: sha512-bVUNBqG6aznYcYjTjnc3+Cat/iBgbgpflxbIBTnsHTX0YVpnmINPEkSRWymT2Q8aSH3Y7aKnEbunilkYe8TybA==}
+ '@commitlint/types@20.2.0':
+ resolution: {integrity: sha512-KTy0OqRDLR5y/zZMnizyx09z/rPlPC/zKhYgH8o/q6PuAjoQAKlRfY4zzv0M64yybQ//6//4H1n14pxaLZfUnA==}
engines: {node: '>=v18'}
'@cspell/cspell-bundled-dicts@9.4.0':
eslint-import-resolver-node:
optional: true
- eslint-plugin-jsdoc@61.4.1:
- resolution: {integrity: sha512-3c1QW/bV25sJ1MsIvsvW+EtLtN6yZMduw7LVQNVt72y2/5BbV5Pg5b//TE5T48LRUxoEQGaZJejCmcj3wCxBzw==}
+ eslint-plugin-jsdoc@61.5.0:
+ resolution: {integrity: sha512-PR81eOGq4S7diVnV9xzFSBE4CDENRQGP0Lckkek8AdHtbj+6Bm0cItwlFnxsLFriJHspiE3mpu8U20eODyToIg==}
engines: {node: '>=20.11.0'}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
resolution: {integrity: sha512-E6rsNU1QNJgB3sjj7OANinGncFKuK+164sLXw1/CqBjj/EkXSoSdHCtWQGBNlREIGLnL7IEUEGa08YFVUbrhVg==}
engines: {node: '>=16'}
- prettier@3.7.3:
- resolution: {integrity: sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==}
+ prettier@3.7.4:
+ resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==}
engines: {node: '>=14'}
hasBin: true
'@biomejs/cli-win32-x64@2.3.8':
optional: true
- '@commitlint/cli@20.1.0(@types/node@24.10.1)(typescript@5.9.3)':
+ '@commitlint/cli@20.2.0(@types/node@24.10.1)(typescript@5.9.3)':
dependencies:
- '@commitlint/format': 20.0.0
- '@commitlint/lint': 20.0.0
- '@commitlint/load': 20.1.0(@types/node@24.10.1)(typescript@5.9.3)
- '@commitlint/read': 20.0.0
- '@commitlint/types': 20.0.0
+ '@commitlint/format': 20.2.0
+ '@commitlint/lint': 20.2.0
+ '@commitlint/load': 20.2.0(@types/node@24.10.1)(typescript@5.9.3)
+ '@commitlint/read': 20.2.0
+ '@commitlint/types': 20.2.0
tinyexec: 1.0.2
yargs: 17.7.2
transitivePeerDependencies:
- '@types/node'
- typescript
- '@commitlint/config-conventional@20.0.0':
+ '@commitlint/config-conventional@20.2.0':
dependencies:
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
conventional-changelog-conventionalcommits: 7.0.2
- '@commitlint/config-validator@20.0.0':
+ '@commitlint/config-validator@20.2.0':
dependencies:
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
ajv: 8.17.1
- '@commitlint/ensure@20.0.0':
+ '@commitlint/ensure@20.2.0':
dependencies:
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
lodash.camelcase: 4.3.0
lodash.kebabcase: 4.1.1
lodash.snakecase: 4.1.1
'@commitlint/execute-rule@20.0.0': {}
- '@commitlint/format@20.0.0':
+ '@commitlint/format@20.2.0':
dependencies:
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
chalk: 5.6.2
- '@commitlint/is-ignored@20.0.0':
+ '@commitlint/is-ignored@20.2.0':
dependencies:
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
semver: 7.7.3
- '@commitlint/lint@20.0.0':
+ '@commitlint/lint@20.2.0':
dependencies:
- '@commitlint/is-ignored': 20.0.0
- '@commitlint/parse': 20.0.0
- '@commitlint/rules': 20.0.0
- '@commitlint/types': 20.0.0
+ '@commitlint/is-ignored': 20.2.0
+ '@commitlint/parse': 20.2.0
+ '@commitlint/rules': 20.2.0
+ '@commitlint/types': 20.2.0
- '@commitlint/load@20.1.0(@types/node@24.10.1)(typescript@5.9.3)':
+ '@commitlint/load@20.2.0(@types/node@24.10.1)(typescript@5.9.3)':
dependencies:
- '@commitlint/config-validator': 20.0.0
+ '@commitlint/config-validator': 20.2.0
'@commitlint/execute-rule': 20.0.0
- '@commitlint/resolve-extends': 20.1.0
- '@commitlint/types': 20.0.0
+ '@commitlint/resolve-extends': 20.2.0
+ '@commitlint/types': 20.2.0
chalk: 5.6.2
cosmiconfig: 9.0.0(typescript@5.9.3)
cosmiconfig-typescript-loader: 6.2.0(@types/node@24.10.1)(cosmiconfig@9.0.0(typescript@5.9.3))(typescript@5.9.3)
'@commitlint/message@20.0.0': {}
- '@commitlint/parse@20.0.0':
+ '@commitlint/parse@20.2.0':
dependencies:
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
conventional-changelog-angular: 7.0.0
conventional-commits-parser: 5.0.0
- '@commitlint/read@20.0.0':
+ '@commitlint/read@20.2.0':
dependencies:
'@commitlint/top-level': 20.0.0
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
git-raw-commits: 4.0.0
minimist: 1.2.8
tinyexec: 1.0.2
- '@commitlint/resolve-extends@20.1.0':
+ '@commitlint/resolve-extends@20.2.0':
dependencies:
- '@commitlint/config-validator': 20.0.0
- '@commitlint/types': 20.0.0
+ '@commitlint/config-validator': 20.2.0
+ '@commitlint/types': 20.2.0
global-directory: 4.0.1
import-meta-resolve: 4.2.0
lodash.mergewith: 4.6.2
resolve-from: 5.0.0
- '@commitlint/rules@20.0.0':
+ '@commitlint/rules@20.2.0':
dependencies:
- '@commitlint/ensure': 20.0.0
+ '@commitlint/ensure': 20.2.0
'@commitlint/message': 20.0.0
'@commitlint/to-lines': 20.0.0
- '@commitlint/types': 20.0.0
+ '@commitlint/types': 20.2.0
'@commitlint/to-lines@20.0.0': {}
dependencies:
find-up: 7.0.0
- '@commitlint/types@20.0.0':
+ '@commitlint/types@20.2.0':
dependencies:
'@types/conventional-commits-parser': 5.0.2
chalk: 5.6.2
transitivePeerDependencies:
- supports-color
- eslint-plugin-jsdoc@61.4.1(eslint@9.39.1(jiti@2.6.1)):
+ eslint-plugin-jsdoc@61.5.0(eslint@9.39.1(jiti@2.6.1)):
dependencies:
'@es-joy/jsdoccomment': 0.76.0
'@es-joy/resolve.exports': 1.2.0
presentable-error@0.0.1: {}
- prettier@3.7.3: {}
+ prettier@3.7.4: {}
prop-types@15.8.1:
dependencies:
/**
* Base class that implements some shared logic for all poolifier pools.
- * @typeParam Worker - Type of worker which manages this pool.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages this pool.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export abstract class AbstractPool<
Worker extends IWorker,
*
* This cluster pool creates new workers when the others are busy, up to the maximum number of workers.
* When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's `emitter`.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
* @author [Christopher Quadflieg](https://github.com/Shinigami92)
* @since 2.0.0
*/
/**
* A cluster pool with a fixed number of workers.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
* @author [Christopher Quadflieg](https://github.com/Shinigami92)
* @since 2.0.0
*/
/**
* Contract definition for a poolifier pool.
- * @typeParam Worker - Type of worker which manages this pool.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages this pool.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export interface IPool<
Worker extends IWorker,
/**
* Options for a poolifier pool.
- * @typeParam Worker - Type of worker.
+ * @template Worker - Type of worker.
*/
export interface PoolOptions<Worker extends IWorker> {
/**
/**
* Worker choice strategy abstract base class.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export abstract class AbstractWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the next worker with a fair share scheduling algorithm.
* Loosely modeled after the fair queueing algorithm: https://en.wikipedia.org/wiki/Fair_queuing.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class FairShareWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the next worker with an interleaved weighted round robin scheduling algorithm.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the least busy worker.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class LeastBusyWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the worker with the least ELU.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class LeastEluWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the least used worker.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class LeastUsedWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the next worker in a round robin fashion.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class RoundRobinWorkerChoiceStrategy<
Worker extends IWorker,
/**
* Selects the next worker with a weighted round robin scheduling algorithm.
* Loosely modeled after the weighted round robin queueing algorithm: https://en.wikipedia.org/wiki/Weighted_round_robin.
- * @typeParam Worker - Type of worker which manages the strategy.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker which manages the strategy.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export class WeightedRoundRobinWorkerChoiceStrategy<
Worker extends IWorker,
/**
* The worker choice strategies context.
- * @typeParam Worker - Type of worker.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Worker - Type of worker.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
* @internal
*/
export class WorkerChoiceStrategiesContext<
*
* This thread pool creates new threads when the others are busy, up to the maximum number of threads.
* When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's `emitter`.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
* @author [Alessandro Pio Ardizio](https://github.com/pioardi)
* @since 0.0.1
*/
/**
* A thread pool with a fixed number of threads.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
* @author [Alessandro Pio Ardizio](https://github.com/pioardi)
* @since 0.0.1
*/
/**
* Worker node.
- * @typeParam Worker - Type of worker.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Worker - Type of worker.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
*/
export class WorkerNode<Worker extends IWorker, Data = unknown>
extends EventEmitter
/**
* Callback invoked if the worker raised an error.
- * @typeParam Worker - Type of worker.
+ * @template Worker - Type of worker.
*/
export type ErrorHandler<Worker extends IWorker> = (
this: Worker,
/**
* Worker event handler.
- * @typeParam Worker - Type of worker.
+ * @template Worker - Type of worker.
*/
export type EventHandler<Worker extends IWorker> =
| ErrorHandler<Worker>
/**
* Callback invoked when the worker exits successfully.
- * @typeParam Worker - Type of worker.
+ * @template Worker - Type of worker.
*/
export type ExitHandler<Worker extends IWorker> = (
this: Worker,
/**
* Callback invoked if the worker has received a message.
- * @typeParam Worker - Type of worker.
+ * @template Worker - Type of worker.
*/
export type MessageHandler<Worker extends IWorker> = (
this: Worker,
/**
* Callback invoked when the worker has started successfully.
- * @typeParam Worker - Type of worker.
+ * @template Worker - Type of worker.
*/
export type OnlineHandler<Worker extends IWorker> = (this: Worker) => void
/**
* Worker node interface.
- * @typeParam Worker - Type of worker.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Worker - Type of worker.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
* @internal
*/
export interface IWorkerNode<Worker extends IWorker, Data = unknown>
/**
* Base fixed queue class.
- * @typeParam T - Type of fixed queue data.
+ * @template T - Type of fixed queue data.
* @internal
*/
export abstract class AbstractFixedQueue<T> implements IFixedQueue<T> {
/**
* Fixed priority queue.
- * @typeParam T - Type of fixed priority queue data.
+ * @template T - Type of fixed priority queue data.
* @internal
*/
export class FixedPriorityQueue<T>
/**
* Fixed queue.
- * @typeParam T - Type of fixed queue data.
+ * @template T - Type of fixed queue data.
* @internal
*/
export class FixedQueue<T>
/**
* Priority queue.
- * @typeParam T - Type of priority queue data.
+ * @template T - Type of priority queue data.
* @internal
*/
export class PriorityQueue<T> {
/**
* Fixed queue node.
- * @typeParam T - Type of fixed queue node data.
+ * @template T - Type of fixed queue node data.
* @internal
*/
export interface FixedQueueNode<T> {
/**
* Fixed queue.
- * @typeParam T - Type of fixed queue data.
+ * @template T - Type of fixed queue data.
* @internal
*/
export interface IFixedQueue<T> {
/**
* Priority queue node.
- * @typeParam T - Type of priority queue node data.
+ * @template T - Type of priority queue node data.
* @internal
*/
export interface PriorityQueueNode<T> extends IFixedQueue<T> {
/**
* Message object that is passed between main worker and worker.
- * @typeParam Data - Type of data sent to the worker or execution response. This can only be structured-cloneable data.
- * @typeParam ErrorData - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker or execution response. This can only be structured-cloneable data.
+ * @template ErrorData - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
* @internal
*/
export interface MessageValue<Data = unknown, ErrorData = unknown>
/**
* An object holding the task execution response promise resolve/reject callbacks.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
* @internal
*/
export interface PromiseResponseWrapper<Response = unknown> {
/**
* Message object that is passed as a task between main worker and worker.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
* @internal
*/
export interface Task<Data = unknown> {
/**
* Worker error.
- * @typeParam Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
*/
export interface WorkerError<Data = unknown> {
/**
/**
* Remove readonly modifier from all properties of T.
- * @typeParam T - Type to remove readonly modifier.
+ * @template T - Type to remove readonly modifier.
* @internal
*/
export type Writable<T> = { -readonly [P in keyof T]: T[P] }
/**
* Detects whether the given value is a kill behavior or not.
- * @typeParam KB - Which specific KillBehavior type to test against.
+ * @template KB - Which specific KillBehavior type to test against.
* @param killBehavior - Which kind of kill behavior to detect.
* @param value - Unknown value.
* @returns `true` if `value` was strictly equals to `killBehavior`, otherwise `false`.
* @param fn - The function to wrap.
* @param context - The context to bind the function to.
* @returns The wrapped function.
- * @typeParam A - The function's arguments.
- * @typeParam R - The function's return value.
- * @typeParam C - The function's context.
+ * @template A - The function's arguments.
+ * @template R - The function's return value.
+ * @template C - The function's context.
* @internal
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-parameters
/**
* Base class that implements some shared logic for all poolifier workers.
- * @typeParam MainWorker - Type of main worker.
- * @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
- * @typeParam Response - Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
+ * @template MainWorker - Type of main worker.
+ * @template Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
+ * @template Response - Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
*/
export abstract class AbstractWorker<
MainWorker extends MessagePort | Worker,
*
* If you use a `DynamicClusterPool` the extra workers that were created will be terminated,
* but the minimum number of workers will be guaranteed.
- * @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
- * @typeParam Response - Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
+ * @template Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
+ * @template Response - Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
* @author [Christopher Quadflieg](https://github.com/Shinigami92)
* @since 2.0.0
*/
* This function must return a promise.
* @param data - Data sent to the worker.
* @returns Execution response promise.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export type TaskAsyncFunction<Data = unknown, Response = unknown> = (
data?: Data
/**
* Task function that can be executed.
* This function can be synchronous or asynchronous.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export type TaskFunction<Data = unknown, Response = unknown> =
| TaskAsyncFunction<Data, Response>
/**
* Task function object.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export interface TaskFunctionObject<Data = unknown, Response = unknown> {
/**
* Tasks functions that can be executed.
* The key is the name of the task function or task function object.
* The value is the task function or task function object.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export type TaskFunctions<Data = unknown, Response = unknown> = Record<
string,
* Task synchronous function that can be executed.
* @param data - Data sent to the worker.
* @returns Execution response.
- * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
- * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
+ * @template Data - Type of data sent to the worker. This can only be structured-cloneable data.
+ * @template Response - Type of execution response. This can only be structured-cloneable data.
*/
export type TaskSyncFunction<Data = unknown, Response = unknown> = (
data?: Data
*
* If you use a `DynamicThreadPool` the extra workers that were created will be terminated,
* but the minimum number of workers will be guaranteed.
- * @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
- * @typeParam Response - Type of response the worker sends back to the main thread. This can only be structured-cloneable data.
+ * @template Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
+ * @template Response - Type of response the worker sends back to the main thread. This can only be structured-cloneable data.
* @author [Alessandro Pio Ardizio](https://github.com/pioardi)
* @since 0.0.1
*/