From: Jérôme Benoit Date: Fri, 11 Aug 2023 19:57:39 +0000 (+0200) Subject: refactor: cleanup http client example X-Git-Tag: v2.6.24~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c97a785f1274883c88a77d2bf418ba6480d20d04;p=poolifier.git refactor: cleanup http client example Signed-off-by: Jérôme Benoit --- diff --git a/examples/typescript/http-client-pool/src/main.ts b/examples/typescript/http-client-pool/src/main.ts index 1f4532c9..f307bb62 100644 --- a/examples/typescript/http-client-pool/src/main.ts +++ b/examples/typescript/http-client-pool/src/main.ts @@ -2,12 +2,12 @@ import { availableParallelism } from 'poolifier' import { httpClientPool } from './pool.js' import { type WorkerResponse } from './types.js' -const parallelism = availableParallelism() +const parallelism = availableParallelism() * 2 const requestUrl = 'http://localhost:8080/' for (const workerFunction of ['node_fetch', 'fetch', 'axios']) { const httpClientPoolPromises = new Set>() - for (let i = 0; i < availableParallelism(); i++) { + for (let i = 0; i < parallelism; i++) { httpClientPoolPromises.add( httpClientPool.execute({ input: requestUrl }, workerFunction) )