X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-server-pool%2Fexpress-hybrid%2Fsrc%2Fmain.ts;h=0f96a313d503b96a518b494fe2de7083798faf1a;hb=1bbea1bc234785d741e62985e0ffb52aafa458d7;hp=561aab5d2832217f50ec4304a858cc94bb72c40a;hpb=fefd3cef3596e4e79dfeea1a1d6dfa39726e2ef5;p=poolifier.git diff --git a/examples/typescript/http-server-pool/express-hybrid/src/main.ts b/examples/typescript/http-server-pool/express-hybrid/src/main.ts index 561aab5d..0f96a313 100644 --- a/examples/typescript/http-server-pool/express-hybrid/src/main.ts +++ b/examples/typescript/http-server-pool/express-hybrid/src/main.ts @@ -1,6 +1,8 @@ import { dirname, extname, join } from 'node:path' import { fileURLToPath } from 'node:url' -import { FixedClusterPool, availableParallelism } from 'poolifier' + +import { availableParallelism, FixedClusterPool } from 'poolifier' + import type { ClusterWorkerData, ClusterWorkerResponse } from './types.js' const expressWorkerFile = join( @@ -17,6 +19,7 @@ const pool = new FixedClusterPool( availableParallelism(), expressWorkerFile, { + enableEvents: false, onlineHandler: () => { pool .execute({ @@ -37,8 +40,7 @@ const pool = new FixedClusterPool( .then(response => { if (response.status) { console.info( - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `Express is listening in cluster worker on port ${response?.port}` + `Express is listening in cluster worker on port ${response.port}` ) } return undefined