X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-client-pool%2Fsrc%2Fpool.ts;h=83bec2fd5ac1dc501a4c6b8cc68ca56721d170c5;hb=b091c3cce0e29f3cd56d60696c0945259def7e79;hp=7fbb20d55ac803f0aac47dee1e287edccd234e63;hpb=ef083f7bb73616d1bd9d9069471edcf6dbaec0c7;p=poolifier.git diff --git a/examples/typescript/http-client-pool/src/pool.ts b/examples/typescript/http-client-pool/src/pool.ts index 7fbb20d5..83bec2fd 100644 --- a/examples/typescript/http-client-pool/src/pool.ts +++ b/examples/typescript/http-client-pool/src/pool.ts @@ -1,6 +1,8 @@ -import { fileURLToPath } from 'node:url' import { dirname, extname, join } from 'node:path' -import { DynamicThreadPool, availableParallelism } from 'poolifier' +import { fileURLToPath } from 'node:url' + +import { availableParallelism, DynamicThreadPool } from 'poolifier' + import type { WorkerData, WorkerResponse } from './types.js' const workerFile = join( @@ -9,16 +11,16 @@ const workerFile = join( ) export const httpClientPool = new DynamicThreadPool( - 1, + 0, availableParallelism(), workerFile, { enableTasksQueue: true, tasksQueueOptions: { - concurrency: 8 + concurrency: 8, }, errorHandler: (e: Error) => { console.error('Thread worker error:', e) - } + }, } )