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=c08e74637a14e5ab18cbca118fdc7387a0512783;hp=7426ed46f62300c701d20ddc9347bc5a58dd0b54;hpb=30369cc0f200d553cfc72fce6e8685c66fa1e344;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 7426ed46..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 'worker_threads' -import { DynamicThreadPool, availableParallelism } from 'poolifier' -import { type FastifyPluginCallback } from 'fastify' +import type { TransferListItem } from 'node:worker_threads' + +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 )