X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fpool.ts;h=de49c93ad6f8c73bc3cfaa680a78134cdd8daa56;hb=89c71c9599fb0a0d437b56704b63aa84f44c7efa;hp=93774422b4500459715ec236c136c1601f13add4;hpb=01d8fcafdb3acd89501cf97e03e8a44198a45eb4;p=poolifier.git diff --git a/examples/typescript/pool.ts b/examples/typescript/pool.ts index 93774422..de49c93a 100644 --- 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, @@ -38,3 +38,9 @@ export const dynamicPool = new DynamicThreadPool>( } } ) + +// eslint-disable-next-line @typescript-eslint/no-misused-promises +setTimeout(async () => { + await fixedPool.destroy() + await dynamicPool.destroy() +}, 3000)