X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Ftypescript%2Fhttp-server-pool%2Ffastify-hybrid%2Fsrc%2Ffastify-poolifier.ts;h=3c5e31e34dc85c9583b29ba427d8cb66704cb686;hb=6bca4154b0b57b8e4b0885a52a77cc8a70dccb88;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..3c5e31e3 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,6 +1,6 @@ -import type { TransferListItem } from 'worker_threads' +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 { type FastifyPoolifierOptions, @@ -22,8 +22,8 @@ const fastifyPoolifierPlugin: FastifyPluginCallback = ( } const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options const pool = new DynamicThreadPool( - minWorkers as number, - maxWorkers as number, + minWorkers!, + maxWorkers!, workerFile, poolOptions )