X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-server-pool%2Ffastify-worker_threads%2Fsrc%2Ffastify-poolifier.ts;h=cd1909b7f3d7eab8f83f781971e452b7108e129d;hb=f952c226dbc985816474d6682d6b151bd6fdb878;hp=85e22c12698cc8d3dbe2fb068c005e993ed8872f;hpb=85d2a65ad4435211edf06c035f87425594044bd2;p=poolifier.git diff --git a/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts b/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts index 85e22c12..cd1909b7 100644 --- a/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts +++ b/examples/typescript/http-server-pool/fastify-worker_threads/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 )