Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: migrate to EventEmitterAsyncResource #91

Merged
merged 6 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.nyc_output
.vscode
.idea
node_modules
dist
coverage
2 changes: 1 addition & 1 deletion benchmark/isolate-benchmark.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { cpus } from 'node:os'
import { Worker } from 'node:worker_threads'

import Tinypool from '../dist/esm/index.js'
import Tinypool from '../dist/index.js'

const THREADS = cpus().length - 1
const ROUNDS = 5_000
Expand Down
2 changes: 1 addition & 1 deletion benchmark/simple-benchmark.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tinypool from '../dist/esm/index.js'
import Tinypool from '../dist/index.js'

async function simpleBenchmark({ duration = 10000 } = {}) {
const pool = new Tinypool({
Expand Down
12 changes: 12 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// only for tsup build, excluded from the final tgz
declare namespace NodeJS {
interface Process {
__tinypool_state__: {
isTinypoolWorker: boolean
isWorkerThread?: boolean
isChildProcess?: boolean
workerData: any
workerId: number
}
}
}
67 changes: 31 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,56 @@
{
"name": "tinypool",
"type": "module",
"version": "0.8.4",
"packageManager": "pnpm@9.0.6",
"description": "A minimal and tiny Node.js Worker Thread Pool implementation, a fork of piscina, but with fewer features",
"type": "module",
"main": "./dist/esm/index.js",
"module": "./dist/esm/index.js",
"license": "MIT",
"homepage": "https://github.com/tinylibs/tinypool#readme",
"repository": {
"type": "git",
"url": "https://github.com/tinylibs/tinypool.git"
},
"bugs": {
"url": "https://github.com/tinylibs/tinypool/issues"
},
"keywords": [
"fast",
"worker threads",
"thread pool"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
"dist"
],
"packageManager": "pnpm@8.4.0",
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"scripts": {
"test": "vitest",
"dev": "tsup --watch",
"build": "tsup",
"publish": "clean-publish",
"prepare": "husky install"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tinylibs/tinypool.git"
},
"keywords": [
"fast",
"worker threads",
"thread pool"
],
"license": "MIT",
"devDependencies": {
"@types/concat-stream": "^1.6.1",
"@types/node": "^15.0.1",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"abort-controller": "^3.0.0",
"@types/node": "^20.12.8",
"clean-publish": "^3.4.4",
"concat-stream": "^2.0.0",
"esbuild": "^0.14.5",
"esbuild-register": "^3.2.1",
"eventemitter-asyncresource": "^1.0.0",
"gen-esm-wrapper": "^1.1.1",
"husky": "^7.0.4",
"nano-staged": "^0.5.0",
"prettier": "^2.5.1",
"regenerator-runtime": "^0.13.9",
"snazzy": "^9.0.0",
"tsup": "^5.11.6",
"typescript": "4.3.x",
"tsup": "^8.0.2",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vitest": "^1.5.0"
},
"bugs": {
"url": "https://github.com/tinylibs/tinypool/issues"
},
"homepage": "https://github.com/tinylibs/tinypool#readme",
"engines": {
"node": ">=14.0.0"
},
"pnpm": {
"overrides": {
"vitest>tinypool": "link:./"
Expand Down
Loading
Loading