From c97a785f1274883c88a77d2bf418ba6480d20d04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 11 Aug 2023 21:57:39 +0200 Subject: [PATCH] refactor: cleanup http client example MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- examples/typescript/http-client-pool/src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) ) -- 2.34.1