| 1 | import type { Worker } from 'node:worker_threads' |
| 2 | import type { PoolOptions } from 'poolifier' |
| 3 | |
| 4 | export interface ClusterWorkerData extends FastifyPoolifierOptions { |
| 5 | port: number |
| 6 | } |
| 7 | |
| 8 | export interface ClusterWorkerResponse { |
| 9 | status: boolean |
| 10 | port?: number |
| 11 | } |
| 12 | |
| 13 | export interface DataPayload { |
| 14 | number?: number |
| 15 | } |
| 16 | |
| 17 | export interface ThreadWorkerData<T = unknown> { |
| 18 | data: T |
| 19 | } |
| 20 | |
| 21 | export interface ThreadWorkerResponse<T = unknown> { |
| 22 | data: T |
| 23 | } |
| 24 | |
| 25 | export interface FastifyPoolifierOptions extends PoolOptions<Worker> { |
| 26 | workerFile: string |
| 27 | minWorkers?: number |
| 28 | maxWorkers?: number |
| 29 | } |