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-hybrid
/
src
/
fastify-worker.ts
diff --git
a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts
b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts
index 388730dcec9bda04a13315f4f0b5fb1814981266..8e4713cfae2df7e3a158c6191a3ec57fc3d8060f 100644
(file)
--- a/
examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts
+++ b/
examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts
@@
-1,8
+1,10
@@
import type { AddressInfo } from 'node:net'
import type { AddressInfo } from 'node:net'
-import { ClusterWorker } from 'poolifier'
+
import Fastify, { type FastifyInstance } from 'fastify'
import Fastify, { type FastifyInstance } from 'fastify'
-import type { ClusterWorkerData, ClusterWorkerResponse } from './types.js'
+import { ClusterWorker } from 'poolifier'
+
import { fastifyPoolifier } from './fastify-poolifier.js'
import { fastifyPoolifier } from './fastify-poolifier.js'
+import type { ClusterWorkerData, ClusterWorkerResponse } from './types.js'
class FastifyWorker extends ClusterWorker<
ClusterWorkerData,
class FastifyWorker extends ClusterWorker<
ClusterWorkerData,
@@
-13,7
+15,7
@@
ClusterWorkerResponse
private static readonly startFastify = async (
workerData?: ClusterWorkerData
): Promise<ClusterWorkerResponse> => {
private static readonly startFastify = async (
workerData?: ClusterWorkerData
): Promise<ClusterWorkerResponse> => {
- const { port, ...fastifyPoolifierOptions } = workerData
as ClusterWorkerData
+ const { port, ...fastifyPoolifierOptions } = workerData
!
FastifyWorker.fastify = Fastify({
logger: true
FastifyWorker.fastify = Fastify({
logger: true
@@
-42,7
+44,7
@@
ClusterWorkerResponse
await FastifyWorker.fastify.listen({ port })
return {
status: true,
await FastifyWorker.fastify.listen({ port })
return {
status: true,
- port: (FastifyWorker.fastify.server.address() as AddressInfo)
?
.port
+ port: (FastifyWorker.fastify.server.address() as AddressInfo).port
}
}
}
}