repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/express-hybrid...
[poolifier.git]
/
examples
/
typescript
/
http-server-pool
/
fastify-worker_threads
/
src
/
fastify-poolifier.ts
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 50668da031705190e5f7611870c51fb2f5fffc7f..85e22c12698cc8d3dbe2fb068c005e993ed8872f 100644
(file)
--- 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
@@
-20,11
+20,12
@@
const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
},
...options
}
},
...options
}
+ const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options
const pool = new DynamicThreadPool<WorkerData, WorkerResponse>(
const pool = new DynamicThreadPool<WorkerData, WorkerResponse>(
-
options.
minWorkers as number,
-
options.
maxWorkers as number,
-
options.
workerFile,
-
o
ptions
+ minWorkers as number,
+ maxWorkers as number,
+ workerFile,
+
poolO
ptions
)
if (!fastify.hasDecorator('pool')) {
fastify.decorate('pool', pool)
)
if (!fastify.hasDecorator('pool')) {
fastify.decorate('pool', pool)
@@
-39,6
+40,7
@@
const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
): Promise<WorkerResponse> => await pool.execute(data, name, transferList)
)
}
): Promise<WorkerResponse> => await pool.execute(data, name, transferList)
)
}
+ done()
}
export const fastifyPoolifier = fp(fastifyPoolifierPlugin, {
}
export const fastifyPoolifier = fp(fastifyPoolifierPlugin, {