X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-server-pool%2Ffastify-hybrid%2Fsrc%2Ffastify-poolifier.ts;h=79d24dc61fe0a3f47a25d4e5fb5ddeb5880e2a2a;hb=e1ba9765afbf97436250d19f28c818221ebc10b9;hp=2d13758028f8105f893226d91ed1c8ff07482949;hpb=624e51e36eb773aa325fa03df96bce20761ab65b;p=poolifier.git diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts index 2d137580..79d24dc6 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts @@ -1,7 +1,9 @@ import type { TransferListItem } from 'node:worker_threads' -import { DynamicThreadPool, availableParallelism } from 'poolifier' -import { type FastifyPluginCallback } from 'fastify' + +import type { FastifyPluginCallback } from 'fastify' import fp from 'fastify-plugin' +import { availableParallelism, DynamicThreadPool } from 'poolifier' + import { type FastifyPoolifierOptions, type ThreadWorkerData, @@ -22,8 +24,8 @@ const fastifyPoolifierPlugin: FastifyPluginCallback = ( } const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options const pool = new DynamicThreadPool( - minWorkers as number, - maxWorkers as number, + minWorkers!, + maxWorkers!, workerFile, poolOptions )