repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): bump @types/node
[poolifier.git]
/
examples
/
typescript
/
pool.ts
diff --git
a/examples/typescript/pool.ts
b/examples/typescript/pool.ts
index 93774422b4500459715ec236c136c1601f13add4..de49c93ad6f8c73bc3cfaa680a78134cdd8daa56 100644
(file)
--- a/
examples/typescript/pool.ts
+++ b/
examples/typescript/pool.ts
@@
-1,5
+1,5
@@
-import { dirname, extname, join } from 'path'
-import { fileURLToPath } from 'url'
+import { dirname, extname, join } from '
node:
path'
+import { fileURLToPath } from '
node:
url'
import type { MyData, MyResponse } from './worker'
import {
DynamicThreadPool,
import type { MyData, MyResponse } from './worker'
import {
DynamicThreadPool,
@@
-38,3
+38,9
@@
export const dynamicPool = new DynamicThreadPool<MyData, Promise<MyResponse>>(
}
}
)
}
}
)
+
+// eslint-disable-next-line @typescript-eslint/no-misused-promises
+setTimeout(async () => {
+ await fixedPool.destroy()
+ await dynamicPool.destroy()
+}, 3000)