import { dirname, extname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { FixedClusterPool, availableParallelism } from 'poolifier'
-import { type ClusterWorkerData, type ClusterWorkerResponse } from './types.js'
+import type { ClusterWorkerData, ClusterWorkerResponse } from './types.js'
const webSocketServerWorkerFile = join(
dirname(fileURLToPath(import.meta.url)),
Math.round(availableParallelism() / 2),
webSocketServerWorkerFile,
{
+ enableEvents: false,
onlineHandler: () => {
pool
.execute({
.then(response => {
if (response.status) {
console.info(
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`WebSocket server is listening in cluster worker on port ${response.port}`
)
}
- return null
+ return undefined
})
.catch(error => {
console.error(