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/fastify-worker_thr...
[poolifier.git]
/
examples
/
typescript
/
http-server-pool
/
fastify-hybrid
/
src
/
request-handler-worker.ts
diff --git
a/examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts
b/examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts
index d3b6c876048afed0392a707f4bae618e7f4e6048..6a88d20a8dd1b733d2947e345c78ca36d1aed368 100644
(file)
--- a/
examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts
+++ b/
examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts
@@
-1,6
+1,6
@@
import { ThreadWorker } from 'poolifier'
import {
import { ThreadWorker } from 'poolifier'
import {
- type
Body
Payload,
+ type
Data
Payload,
type ThreadWorkerData,
type ThreadWorkerResponse
} from './types.js'
type ThreadWorkerData,
type ThreadWorkerResponse
} from './types.js'
@@
-13,8
+13,8
@@
const factorial: (n: number) => number = (n) => {
}
class RequestHandlerWorker<
}
class RequestHandlerWorker<
- Data extends ThreadWorkerData<
Body
Payload>,
- Response extends ThreadWorkerResponse<
Body
Payload>
+ Data extends ThreadWorkerData<
Data
Payload>,
+ Response extends ThreadWorkerResponse<
Data
Payload>
> extends ThreadWorker<Data, Response> {
public constructor () {
super({
> extends ThreadWorker<Data, Response> {
public constructor () {
super({
@@
-23,7
+23,7
@@
class RequestHandlerWorker<
},
factorial: (workerData?: Data) => {
return {
},
factorial: (workerData?: Data) => {
return {
-
body: { number: factorial(workerData?.body
?.number as number) }
+
data: { number: factorial(workerData?.data
?.number as number) }
} as unknown as Response
}
})
} as unknown as Response
}
})
@@
-31,6
+31,6
@@
class RequestHandlerWorker<
}
export const requestHandlerWorker = new RequestHandlerWorker<
}
export const requestHandlerWorker = new RequestHandlerWorker<
-ThreadWorkerData<
Body
Payload>,
-ThreadWorkerResponse<
Body
Payload>
+ThreadWorkerData<
Data
Payload>,
+ThreadWorkerResponse<
Data
Payload>
>()
>()