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
/
websocket-server-pool
/
ws-cluster
/
src
/
main.ts
diff --git
a/examples/typescript/websocket-server-pool/ws-cluster/src/main.ts
b/examples/typescript/websocket-server-pool/ws-cluster/src/main.ts
index 8779c6dcf309ae49b4960abd4ac216af17582a25..ebf35134f97b53db152f56ffa3fd15fa81ea9f84 100644
(file)
--- a/
examples/typescript/websocket-server-pool/ws-cluster/src/main.ts
+++ b/
examples/typescript/websocket-server-pool/ws-cluster/src/main.ts
@@
-15,26
+15,24
@@
const pool = new FixedClusterPool<WorkerData, WorkerResponse>(
onlineHandler: () => {
pool
.execute({ port: 8080 })
onlineHandler: () => {
pool
.execute({ port: 8080 })
- .then(
response
=> {
+ .then(
(response)
=> {
if (response.status) {
console.info(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
if (response.status) {
console.info(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- `WebSocket server is listening on worker on port ${response.port}`
- )
- } else {
- console.error(
- 'WebSocket server failed to start on worker:',
- response.error
+ `WebSocket server is listening in cluster worker on port ${response.port}`
)
}
return null
})
)
}
return null
})
- .catch(error => {
- console.error(error)
+ .catch((error) => {
+ console.error(
+ 'WebSocket server failed to start in cluster worker:',
+ error
+ )
})
},
errorHandler: (e: Error) => {
})
},
errorHandler: (e: Error) => {
- console.error(e)
+ console.error(
'Cluster worker error',
e)
}
}
)
}
}
)