refactor: use default options values in fastify example
[poolifier.git] / examples / typescript / http-server-pool / fastify / src / main.ts
index 5bf714aaf0c300c701a2a3bd235908e7034489d7..c17de65b9628e3b818030ecb7a2259195c7da6db 100644 (file)
@@ -1,9 +1,12 @@
 import { dirname, extname, join } from 'node:path'
 import { fileURLToPath } from 'node:url'
 import Fastify from 'fastify'
-import { availableParallelism } from 'poolifier'
 import { fastifyPoolifier } from './fastify-poolifier.js'
 
+/**
+ * The fastify server is still a single-threaded application, but the request handling can be multi-threaded.
+ */
+
 const port = 8080
 const fastify = Fastify({
   logger: true
@@ -16,8 +19,6 @@ const workerFile = join(
 
 await fastify.register(fastifyPoolifier, {
   workerFile,
-  minWorkers: 1,
-  maxWorkers: availableParallelism(),
   enableTasksQueue: true,
   tasksQueueOptions: {
     concurrency: 8