X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fpool.ts;h=57898d98a9d53a8c89c3d774847e9cae694a53fe;hb=fce683a9095d2bb0dc39821be216ffe9aaea0457;hp=93774422b4500459715ec236c136c1601f13add4;hpb=01d8fcafdb3acd89501cf97e03e8a44198a45eb4;p=poolifier.git diff --git a/examples/typescript/pool.ts b/examples/typescript/pool.ts index 93774422..57898d98 100644 --- a/examples/typescript/pool.ts +++ b/examples/typescript/pool.ts @@ -1,6 +1,6 @@ -import { dirname, extname, join } from 'path' -import { fileURLToPath } from 'url' -import type { MyData, MyResponse } from './worker' +import { dirname, extname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import type { MyData, MyResponse } from './worker.js' import { DynamicThreadPool, FixedThreadPool, @@ -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)