From: Jérôme Benoit Date: Sat, 16 Dec 2023 16:02:37 +0000 (+0100) Subject: fix: fix types definition in examples X-Git-Tag: v3.1.1~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1220758f75fdee2cc2914edfd55ccd7665291f1c;p=poolifier.git fix: fix types definition in examples Signed-off-by: Jérôme Benoit --- diff --git a/examples/typescript/http-server-pool/express-hybrid/src/types.ts b/examples/typescript/http-server-pool/express-hybrid/src/types.ts index 76a9133e..16fe86fe 100644 --- a/examples/typescript/http-server-pool/express-hybrid/src/types.ts +++ b/examples/typescript/http-server-pool/express-hybrid/src/types.ts @@ -1,6 +1,7 @@ -import type { ThreadPoolOptions } from 'poolifier' +import type { Worker } from 'worker_threads' +import type { PoolOptions } from 'poolifier' -export interface ClusterWorkerData extends ThreadPoolOptions { +export interface ClusterWorkerData extends PoolOptions { port: number workerFile: string minWorkers?: number diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/types.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/types.ts index 179ac65e..2ef0d1ce 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/types.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/types.ts @@ -1,4 +1,5 @@ -import type { ThreadPoolOptions } from 'poolifier' +import type { Worker } from 'worker_threads' +import type { PoolOptions } from 'poolifier' export interface ClusterWorkerData extends FastifyPoolifierOptions { port: number @@ -21,7 +22,7 @@ export interface ThreadWorkerResponse { data: T } -export interface FastifyPoolifierOptions extends ThreadPoolOptions { +export interface FastifyPoolifierOptions extends PoolOptions { workerFile: string minWorkers?: number maxWorkers?: number diff --git a/examples/typescript/http-server-pool/fastify-worker_threads/src/types.ts b/examples/typescript/http-server-pool/fastify-worker_threads/src/types.ts index 97c2c540..4293ab84 100644 --- a/examples/typescript/http-server-pool/fastify-worker_threads/src/types.ts +++ b/examples/typescript/http-server-pool/fastify-worker_threads/src/types.ts @@ -1,4 +1,5 @@ -import type { ThreadPoolOptions } from 'poolifier' +import type { Worker } from 'worker_threads' +import type { PoolOptions } from 'poolifier' export interface BodyPayload { number?: number @@ -12,7 +13,7 @@ export interface WorkerResponse { body: T } -export interface FastifyPoolifierOptions extends ThreadPoolOptions { +export interface FastifyPoolifierOptions extends PoolOptions { workerFile: string minWorkers?: number maxWorkers?: number diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/src/types.ts b/examples/typescript/websocket-server-pool/ws-hybrid/src/types.ts index d52dbf23..49f115de 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/src/types.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/src/types.ts @@ -1,4 +1,5 @@ -import type { ThreadPoolOptions } from 'poolifier' +import type { Worker } from 'worker_threads' +import type { PoolOptions } from 'poolifier' export enum MessageType { echo = 'echo', @@ -14,7 +15,7 @@ export interface DataPayload { number?: number } -export interface ClusterWorkerData extends ThreadPoolOptions { +export interface ClusterWorkerData extends PoolOptions { port: number workerFile: string minWorkers?: number